0

I have a question regarding the validations to be done on a text box where user can enter either Ip/HostName. The main question is regarding the period symbol (.). Is that allowed in a host name?

Also if period is allowed in a HostName then why does my windows OS complain :

enter image description here

ayush
  • 14,350
  • 11
  • 53
  • 100

1 Answers1

0

Hostnames are governed by RFC 952 and amended by RFC 1123 where you can see that a hostname can have the form abc.def.ghi:

<names> ::= ... <official hostname> ...
<official hostname> ::= <hname>
<hname> ::= <name>*["."<name>]
<name>  ::= <let>[*[<let-or-digit-or-hyphen>]<let-or-digit>]

(I have extracted the relevant parts of the grammar in RFC952 above - RFC1123 allows the first character to be a digit also)

I believe that the alert box you're seeing is about Windows (WINS?) not allowing dots in computer names.

Cheers,

Community
  • 1
  • 1
Anders R. Bystrup
  • 15,729
  • 10
  • 59
  • 55