I have added the following line in my hosts file: C:\Windows\System32\drivers\etc\hosts
127.0.0.1 firsthostfirsthostfirsthostfirsthostfirsthostfirsthostfirsthost
The above is working fine(length is 63), able to ping and the host is responding. But if I put the hostname as
127.0.0.1 firsthostfirsthostfirsthostfirsthostfirsthostfirsthostfirsthostf
(Here the length is 64.),a message is shown: "Ping request could not find host firsthostfirsthostfirsthostfirsthostfirsthostfirsthostfirsthostf. Please check the name and try again."
Please help me to understand the cause. Any reference link would be appreciated.
Thanks in advance.
RFC 1035 limits the length of a fully-qualified domain name (FQDN) to 255 characters, and each "label" - the portion between dots - to 63 characters.
Your first example works because it's a 63 character label. Your second example fails because it doesn't comply with the rules set out in RFC 1035.