Re: computer name length issue
- From: Tommy <bad@xxxxxxxxxxxxx>
- Date: Tue, 16 Dec 2008 08:14:52 -0500
George wrote:
Hello everyone,
Any macro used to represent computer name max length (just host name max length itself, not full-qualified with domain suffix, for example, I just want host name "somehost" in example.com domain, but not "somehost.example.com")?
http://msdn.microsoft.com/en-us/library/ms724301(VS.85).aspx
MAX_COMPUTERNAME_LENGTH is too small and just 15 characters.
thanks in avdance,
George
This length is reflective of the old NETBIOS computer name which was 8 characters, 15 on then newer Windows OSes.
Anything beyond that is using internet domains and the netbios name is not necessarily the subdomain.
For example I can have a computer name as XYZ. That doesn't mean the computer automatically has domain name as xyz.example.com. That is established by DNS A/PTR/CNAME records.
However, what Microsoft did a long time ago when they finally added Internet (TCP/IP networking) support over its NETBIOS based LAN support, was WINS (Windows Internet Names Server) which ties the IP address of the machine with the netbios computer name.
Anyway, you have to live with the fact that Computer Names are historically limited, 8 to true "All safe" limit. Not all software will support more than that. To expect more, you can get into bugse. But I think today, using 15 is pretty safe. Just don't be surprise if you use 15 or more that OTHER software will work.
Alsoremember, NETBIOS names are not the same as internet sub-domains. That is only TRUE when the network administrator has made it that way via DNS and WINS.
For example, suppose you have a computer called MYCOMPUTER123, in DNS, you can create a A record for the same computer
123.123.123.123 A ThisIsMyComputer123.example.com
and its a sub-domain of a real internet subdomain, however, MYCOMPUTER123.example.com is not, unless your network person adds an A record too for it:
123.123.123.123 A MyComputer123.example.com
In short, if you want the real sub-domain, you need to
A) Get the IP address for the machine
B) Perform a PTR record lookup to obtain all the A records
Help this provides such insight into this.
Windows Socket layer, if I remember off hand, will return the computer name if there are not domain names for it. But that logic has changed over the the years depending on what OS you have. Windows also characters depending on how the network is setup.
This is why, IMO, it is safer to use DNS (be a DNS client) to resolve IP and domains names on a machine.
--
.
- Follow-Ups:
- Re: computer name length issue
- From: Tommy
- Re: computer name length issue
- References:
- computer name length issue
- From: George
- computer name length issue
- Prev by Date: computer name length issue
- Next by Date: Re: computer name length issue
- Previous by thread: computer name length issue
- Next by thread: Re: computer name length issue
- Index(es):
Relevant Pages
|