![]() |
News | Profile | Code | Photography | Looking Glass | Projects | System Statistics | Uncategorized |
Blog |
Over the past couple weeks I've had to figure out how to change the default name resolution behavior for short names containing dots on at least two operating systems: Windows 7 and Mac OS 10.7. It's starting to get annoying.
I've always found it quite useful to be able to connect to hosts using a short name like cr0.nyc instead of cr0.nyc.bb.isp.com. If the DNS for all the loopback addresses of my routers are within the bb.isp.com. zone, then I shouldn't ever have to type the FQDN if my default search prefix is bb.isp.com.
Sure, this generates additional lookups most of the time. Take this mostly fictious example:
(destiny:21:48)% telnet -6 em0.dax Trying 2001:48c8:1:2::2... telnet: Unable to connect to remote host: Connection refused
The above results in the following:
21:49:00.525997 IP 10.3.5.107.51245 > 10.3.5.1.53: 44160+ AAAA? em0.dax. (25) 21:49:00.560909 IP 10.3.5.1.53 > 10.3.5.107.51245: 44160 NXDomain 0/1/0 (100) 21:49:00.561096 IP 10.3.5.107.36493 > 10.3.5.1.53: 6644+ AAAA? em0.dax.prolixium.net. (39) 21:49:00.561414 IP 10.3.5.1.53 > 10.3.5.107.36493: 6644* 1/7/13 AAAA 2001:48c8:1:2::2 (488)
It's fictious because dax doesn't run a telnet daemon, duh. The resolver library assumes "dax" might be a TLD, so it qualifies it with a "." and sends it to the DNS server, which returns NXDOMAIN. The next query is appended with the search suffix (prolixium.net, in this case) and succeeds. This all happens because on a traditional Unix system, /etc/resolv.conf has a "ndots" directive that defaults to 1, which means that any name containing a dot will be tried absolutely (ie, qualified and sent to the resolver). This ndots value can be set to something higher than 1, which might result in something like this in the worst case if I tried to visit http://twc.com/:
21:43:31.052253 IP 10.3.5.107.39468 > 10.3.5.1.53: 54327+ A? twc.com.prolixium.com. (39) 21:43:31.052476 IP 10.3.5.1.53 > 10.3.5.107.39468: 54327 NXDomain* 0/1/0 (108) 21:43:31.052592 IP 10.3.5.107.44456 > 10.3.5.1.53: 33643+ A? twc.com. (25) 21:43:31.052811 IP 10.3.5.1.53 > 10.3.5.107.44456: 33643 1/2/0 A 165.237.62.28 (85)
Anyway, it seems that some newer operating systems take a completely different approach if the short name has dots - they don't ever try to append the suffix by default. For example, if I want to connect to dax.prolixium.com. I can still type in dax and get there just fine. However, if I want to hit em0.dax.prolixium.net. by typing in em0.dax, I would get a lookup failure. For Windows 7, SimAda00 provided a solution in this thread:
For Mac OS 10.7, this link has the solution, although you can follow the quick & dirty exerpt below:
In addition to the above, some web browsers like Google Chrome are starting to make short names more annoying to use. For example, if I haven't been to dax.prolixium.com. before, and I wanted to connect to it by just simply typing dax, I might see something like the following:
After clicking on "http://dax/" in the infobar, I wouldn't ever have to do it again unless I cleared my browsing history. I don't know of a way to disable this, but this thread from Chromium-discuss seems to shed some light on the rationale for it. Another way around it is to type dax/ instead of just dax. Firefox doesn't seem to have this annoyance, but Internet Explorer 10.0 (at least the version that's included in the Windows 8 preview) doesn't even give you an infobar-type of message for short names - it just throws the short name at your default search engine. Adding a trailing slash still works, though.
Quite annoying.
New comments are currently disabled for this entry.
![]() ![]() ![]() ![]() ![]() |
This HTML for this page was generated in 0.001 seconds. |