问题
I need to store the machine name in a database field, so I need to know how big to make the field.
So is there a limit on the length of a machine name?
If so what is the limit?
Can I machine name be Unicode?
回答1:
This KB article says 255 bytes for the FQDN and it does support Unicode.
http://support.microsoft.com/kb/909264
DNS domain names
The maximum length of the host name and of the fully qualified domain name (FQDN) is 63 octets per label and 255 bytes per FQDN. This maximum includes 254 bytes for the FQDN and one byte for the ending dot.
In Windows 2000 and in Windows Server 2003, the maximum host name and the FQDN use the standard length limitations that are mentioned earlier, with the addition of UTF-8 (Unicode) support. Because some UTF-8 characters exceed one octet in length, you cannot determine the size by counting the characters.
回答2:
RFC 1035 says 63 characters. Tried it on a XP box and it would only allow 63 characters..
来源:https://stackoverflow.com/questions/4097282/what-is-the-limit-on-the-machine-name-in-window-server