13

I need to make validation for domain name length in my PHP programming. Can you please suggest me min and max length required for domain name. I tried to find out in google but I am unable to find out proper solution for it.

Vipul Jethva
  • 647
  • 1
  • 7
  • 27

3 Answers3

10

According to this resource you can find websites with single letter and com. I hope that will help you.

Mr.D
  • 7,353
  • 13
  • 60
  • 119
  • 1
    I was try in godaddy hosting server they don't allow me y.com or 1 letter length. – Vipul Jethva Apr 27 '16 at 13:24
  • 1
    Maybe it is already in use or some hostings has their own domain validations. – Mr.D Apr 27 '16 at 14:13
  • 2
    @VipulJethva According to [Nic AG](http://www.nic.ag/rules.htm): `Domain names cannot have more than 63 characters, not including .AG, .COM.AG, .NET.AG, .ORG.AG, .EDU.AG, .GOV.AG, ETC. Minimum length of a domain name is 1 character, not including extensions. However, all 1 character domain names are reserved by the Registry.` – rolling_codes Oct 09 '18 at 16:54
  • @NoodleOfDeath Will you please give me any site name which has 1 or 2 characters on it? Just for my knowledge – Vipul Jethva Oct 10 '18 at 13:42
  • 4
    @VipulJethva Sure! Amazon beat Apple to [a.co](https://a.co); Google is [g.co](https://g.co); Facebook [m.me](https://m.me); Twitter [t.co](https://t.co); Wordpress [w.org](https://w.org). You can find even more [here](https://en.wikipedia.org/wiki/Single-letter_second-level_domain) – rolling_codes Oct 10 '18 at 15:19
  • @VipulJethva as of 1993, one letter domain names became reserved for registry; the examples I listed above were reserved before that international decision and grandfathered in and allowed to remain. – rolling_codes Oct 10 '18 at 15:26
  • Another good reference is https://en.wikipedia.org/wiki/Single-letter_second-level_domain – Taylor D. Edmiston Apr 26 '20 at 14:20
  • 1
    `x.com` was owned by Elon Musk and then PayPal for a while. – adrianTNT Sep 21 '20 at 13:00
1

The max limit is set out here https://www.rfc-editor.org/rfc/rfc1035#section-2.3.4.

Label limit 63 characters (strings between periods)

Name limit 255 characters (total of the strings combined together)

Community
  • 1
  • 1
codeymcgoo
  • 565
  • 4
  • 8
-3

Minimum Domain Name Length Is 3 Characters and Maximum of 63. Hosting for 1 or 2 characters only is too expensive and you might not want it for its not yet open for public use.

  • > No one goes there anymore, it's too crowded. g.co is a very commonly used link shortener, for example. – krakatoa Nov 13 '22 at 19:43