Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

The .local domain and DNS issues Network
I found this the hard way, and since I see others have run into the same problem without listing a definite solution, I thought I'd make this easy to find.

OSX (at least 10.2 and on) will not resolve .local names via DNS. lookupd's DNSAgent simply refuses to issue queries for them. This gives the strange situation where nslookup foo.bar.local returns the correct information while ping foo.bar.local returns an 'unknown host' error.

This is documented in Apple's Knowledge Base (article 107174), but if you didn't think to browse the Rendezvous docs for DNS problems, you'd probably never find it. Apple's recommendation is to simply change your domain from .local to .home, .office or .lan. I've done that here, but with well-established kerberos and afs servers in the .local domain, it was anything but simple (or pleasant).

The only other workaround I know of is to populate each Mac's /etc/hosts file with all the local IPs and hostnames (e.g., "10.0.0.1 foo.bar.local foo"), and then change lookupd's search order with the following command (shown on two lines, but the backslash should allow a copy and paste to work):
nicl . -create /locations/lookupd/hosts \
LookupOrder Cache FF DNS NI DS
The tradeoff here is that while names in .local now resolve correctly, you've got the fun of keeping your /etc/hosts files in sync. That's probably why you installed a DNS server in the first place.

Finally, I have no idea how this workaround might affect Rendezvous. I do know that disabling Rendezvous completely had no affect on .local name resolutions.
    •    
  • Currently 3.67 / 5
  You rated: 5 / 5 (3 votes cast)
 
[41,652 views]  

The .local domain and DNS issues | 17 comments | Create New Account
Click here to return to the 'The .local domain and DNS issues' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
STOP!
Authored by: Anonymous on Dec 12, '02 12:23:17PM

if you want still to use Rendezvous, choose an other local domain extension!

like .home or .myself ...

.local is reserved for Rendezvous usage, and you'll be sorry is it stop's working someday.



[ Reply to This | # ]
another solution
Authored by: matx on Dec 12, '02 08:14:50PM

our entire network is based on this .local thing.

it's not a good solution just to change everything we run to .home etc

the windows admins don't see it as a solution... ;)

10.2 was an unpleasant surprise in this area... no more name resolution... :(

SOLUTION:
we just changed our LOCAL entries
in /etc/resolver/local

to list our local name servers and changed port to 53

seems to work again...

:)

matx



[ Reply to This | # ]
another solution
Authored by: dlove on Dec 13, '02 07:21:08AM

That's excellent! I wish I'd known about it before I'd renamed our domain. Where'd you find out about /etc/resolver/*?

And for the record, yes, this does break Rendezvous. I don't personally consider that a loss, but YMMV. Proceed with caution. ;-)



[ Reply to This | # ]
another solution
Authored by: matx666 on Dec 13, '02 10:32:37AM

well, when 10.2 first came out and it broke our domain name resolution, we searched
hi and lo for a solution and found one on the apple discussion boards... someone had
figured this thing out (/etc/resolver/local). congrats to them. it works.

who needs rendezvous, not yet anyway.



[ Reply to This | # ]
another solution
Authored by: bluehz on Dec 13, '02 01:32:04PM

Yes where did you find out about resolver? I never heard anything about it. Just checked mine and its says:

nameserver 224.0.0.251
port 5353
timeout 1

I don't know WHAT the heck that is....none of my info...



[ Reply to This | # ]
another solution
Authored by: dlove on Dec 16, '02 01:46:25PM

That's Rendezvous' "Multicast DNS" information. Fortunately MDNS uses standard DNS queries, so replacing that info with your DNS server's ip and port 53 results in standard DNS queries being issued for the .local domain.

I tried dropping a foo.local file in that directory to see if subdomains would then resolve correctly, but it appears .local always gets processed first.



[ Reply to This | # ]
localhost
Authored by: bluehz on Dec 13, '02 09:01:13AM

Not sure if this is related - but ever since upgrading to Jaguar I can no longer access my local machine via "localhost". I have a Linux box I have used for over a year with my DNS server and localhost has always worked for me. All the machines within my LAN or named with .lan conventions. If I want to access my local machine - I have to use the .lan defined name instead of localhost. I can watch it and see whats happening too - the local machine is querying the DNS server for a machine named "localhost" and of course its not finding one.

Also - oddity in my /etc/hosts file - anyone have this also or can I get rid of it...
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost

What is that last localhost entry for? I did not put it there - and it was not there before.



[ Reply to This | # ]
localhost
Authored by: sven on Dec 13, '02 01:28:07PM

"::1 localhost" is the ipv6 version of 127.0.0.1, probably added by the network config tools



[ Reply to This | # ]
localhost
Authored by: Hous68 on Dec 14, '02 06:06:39PM

I have this entry in my /etc/hosts file too.

In addition, I have another DNS issue with Jaguar...

On my local network, I have my own DNS (Bind9) doing split horizon DNS (internal requests get results from one view, external requests get results from another view). In my Network PrefPane, I have my internal DNS listed first followed by two provided by my ISP. On a boot/restart everything works fine; my Mac gets DNS resolutions properly. But after the Mac goes to sleep, or sits for an extended period, it forgets about the internal DNS server and queries external servers. A re-apply in the Network PrefPane resolves the problem until the next time the Mac sleeps. No other non-Mac on my network has this problem (Win, Linux, *BSD).

Bizarre.



[ Reply to This | # ]
localhost
Authored by: dlove on Dec 16, '02 03:12:59PM

Out of curiousity, the next time your mac comes back from sleep, try running 'host some_machine your_mac' and see if you get a valid response. That should at least tell you if it's a bind/sleep issue, or an Apple resolver/sleep issue. My suspicion is that latter.

From playing around here, it looks like lookupd cycles throught the nameservers declared in /etc/resolv.conf until it finds one that works and then sticks with that nameserver until either it times out, or the modification date on /etc/resolv.conf is changed ('touch /etc/resolv.conf' as root is sufficient).

The host and nslookup commands, on the other hand, always start each query with the first server listed. That seems to be consistent with the resolv.conf man page. Yet another situation where 'ping foo' fails and 'host foo' succeeds.

So it looks like every time your system wakes from sleep, lookupd think its current nameserver choice has timed out and cycles to the next one. Since that server answers, you never get back to your internal server.

What I've done here is to setup a DNS cache machine which all the local machines use as their DNS server. The cache machine sends local queries to the local DNS server and everything else to my ISP's DNS servers. My resolv.conf only contains a single nameserver entry, so I've never hit this particular problem. Unfortunately I can't remember how to set this up in Bind (I switched to djbdns years ago), but it should be possible.

Hope this helps.



[ Reply to This | # ]
Mixed DNS servers
Authored by: ptwithy on Oct 28, '03 06:33:05AM

DNS servers are not ordered, have no priority. If you have more than one server, they must all present the same view of the DNS. This same issue arises with a VPN: you cannot have DNS servers that know about the VPN mixed with those that do not, or you will get inconsistent results.



[ Reply to This | # ]
The etc/resolver/local entry....
Authored by: jimr on Dec 16, '02 04:22:37PM
That entry is for Rendezvous. Works with things such as iChat on local network The curious, the dumbfounded, should have a look Here at O'Reilly
and

Here at iana
as a primer
before changing anything finally, read the last part of How to set up DNS on Mac OS X 10.1.x: by sal paradise --Nov 11,2001 looks like Apple answered a request...regarding multicast DNS requests

[ Reply to This | # ]
The etc/resolver/local entry....
Authored by: atoms on Dec 10, '03 07:14:23PM
That O'Reilly link is now: http://www.oreillynet.com/pub/wlg/1920

[ Reply to This | # ]
Quick solution ...
Authored by: afreeman on Dec 26, '02 05:12:50PM

Since I run a mixed network, I found it easier to add my Mac's address into my Winclones host file. That way everything resolves nicely without relying on the Mac being attached to the network.



[ Reply to This | # ]
The .local domain is USED by several organizations!
Authored by: rcarmo on Feb 25, '03 07:42:25PM

This is easily one of the most boneheaded approaches to DNS I've seen from a vendor in a long while.

My experience with this is that 10.2 completely breaks hostnames like "x.corporate.local", which is fundamentally wrong.

I have had to resort to mangling the /etc/resolver/local file to get my mac to access internal sites, which is a plain stupid thing for Apple to force its corporate customers to do.

Apple should realize that .local is a perfectly reasonable suffix for an internal LAN within a large organization, and that corporates actually USE it.



[ Reply to This | # ]
The .local domain and DNS issues
Authored by: duus on Jun 01, '03 07:37:34AM
The solution I came up with based on some of the other hints in this section is modifying your /etc/resolver/local file and insert your local .local nameserver in front of the rendevouz server
This is my anonymized version :

nameserver 192.168.x.y
nameserver 192.168.z.q
nameserver 224.0.0.251
port 53
timeout 1


[ Reply to This | # ]
The .local domain and DNS issues
Authored by: sqcircle on May 12, '06 11:50:56AM

Check this out:
Mac OS X 10.3, 10.4: How to look up ".local" hostnames via both Bonjour and standard DNS
http://docs.info.apple.com/article.html?artnum=107800



[ Reply to This | # ]