A DNS resolution question

rickb

Registered
Can someone point me to documentation on how DNS name resolution works in OSX PB?

Problem: I used the 'hosts' file in OS 9 to sink references to advertisers. How do I get OS X to search my old 'hosts' file during name resolution?
 
Thanks. I also found this.

However...
My 'hosts' file is pretty long and I don't want to enter it all, one address at time.
I dimly remember being able to configure 'bind' to search the 'hosts' file before searching other domainname servers.

Unfortunately, I don't understand how name resolution is implemented in OS X.
'named' is present but there is no '/etc/named.conf'.
'dig' is also present but I don't know how to use it.

I'm sure there is a cool way to do this, after all it is UNIX and also a Mac.

I need a DNS guru to explain how to specify a file(s) to search before requesting an address from a name server.

I sure this would be useful to a lot of folks.
 
how about /etc/resolv.conf?

mine looks like this:

domain bla.somedomain.com
nameserver 1.2.3.4
nameserver 2.3.4.5
search bla.somedomain.com

you should be able to add localhost to the list...
 
oh, also - are you using 'nslookup'? that is the best way to check dns stuff.

you can do one liners like 'nslookup blah'

or you can enter the program with 'nslookup', you get a '>' prompt and can enter domain names to see how they are resolved, and it also returns the nameserver it is using. you can check your local dns server by typing 'set localhost' ...

hope this is relevant...
 
Hmmm.
My '/etc/resolve.conf' is a symbolic link to a file ('/var/run/resolve.conf') that doesn't exist on my system.
 
i found that to be true on mine as well. but on my solaris box it is an actual file so I got rid of the link on osx and made a real file /etc/resolv.conf ...

before i did that, nslookup would not do anything - said it was using 0.0.0.0 for a host server, and i could not change it. after creating the resolv file, it worked like a champ...
 
Originally posted by hotani
i found that to be true on mine as well. but on my solaris box it is an actual file so I got rid of the link on osx and made a real file /etc/resolv.conf ...

before i did that, nslookup would not do anything - said it was using 0.0.0.0 for a host server, and i could not change it. after creating the resolv file, it worked like a champ...

Hrrm... You also could have created /var/run/resolv.conf.. ;>

Also, I'm not sure about this, but does OS-X beta use nsswitch.conf?... If it does you can configure it to look first in the hosts file and then look in DNS if it doesn't find it there.... Since I don't have an OS-X beta system here I can't really know for sure, but you might want to look into it...

- Greg
 
Thanks for the suggestions everybody.
I haven't tried them all but it looks like I will. :(

I have decided that using the 'Terminal' is cheating and that the solution must be found using the GUI.

The following doesn't work yet but I'm hopeful.
Using info I extracted from Darwin I tried the following

1) In 'NetInfoManager' find 'locations'
2) create a subdirectory 'lookupd'
3) under that create a directory 'hosts'
4) create a NewProperty 'LookupOrder'
4) append values from
'CacheAgent' - searchs lookupd's cache
'FFAgent' -looks up information in flat-files(/etc/hosts )
'NIAgent' - looks up info in NetInfo
'DNSAgent' - looks up info in DNS
'NISAgent' - looks up info in NIS

The agent order is supposed to be the search order.
My first attempt failed but this looks promising.
When I get time, I'll experiment some more. :)
 
I also had this nslookup problem. The recommended fix of deleting the symlink and recreating a real file with the right data fixed the problem. It works like a champ....

-gtb
 
Thanks.
I tried it and it works.
John Welch in an article at MacWeek provided a link to a NIS reference that I found helpful. Take a look at <http://www.bresink.de/osx/nis.html>.
 
Back
Top