HI all,
Ok I have a slightly different DNS setup. I want to query a specific host for DNS resolution but do the "normal" thing for everything else. Additionally I want to be a local domain server for my home intranet. Oh and if that wasn't enough of a challenge, I want the intranet domain to be .local and I'm running macs. (If you don't know this, mac's don't like to resolve the .local domain it's local... ) Here is how you go about it
Out strategy is to use dbjdns to set-up a local DNS cache for all of our internal servers. That will then allow all querying to for all domains. Then we will deal with resolving the company domains. Lastly we will tackle the .local domain and DNS resolution there. As a side note most of this information is up on Dan Bernstein ( the author of dbjdns ) website. Unfortunately he is a great ( one of the best out there ) programmer, but his documentation has always been (at least for me) very difficult to follow. Not that mine is any better, it isn't. This was put here for me and anyone else to gleam some useful knowledge from
( I assume that you have already obtained djbdns and followed the instructions to get it installed )
Note: Keep in mind that if you want to run BOTH a cache and a DNS server you need two IP's.. Linux can easily do this with aliasing!
Part 1 - Setting up a simple DNS cache
This is the easy part and is well documented.. Follow these instructions
Don't forget when you get done - verify that resolv.conf points to the server and check it..
dnsip www.cnn.com
Part 2 - Get your company intranet domains to be resolved by the company's intranet DNS Server
I work for company foo and I happen to have a VPN connection to the site. But I can't resolve any of foo's internal addresses because they aren't public. So I want to defer my queries for foo.com to a different ( internal server )
This is also documented but in a not-so-easy place. You must know the internal DNS server(s) of the company foo. So using them..
cd /service/dnscache
echo <DNS SERVER> > root/servers/foo.com
echo <DNS SERVER2> >> root/servers/foo.com
chmod 644 root/servers/foo.com
svc -t .
Don't forget when you get done - verify we can get an IP for an internal name
dnsip hostname.foo.com
Part 3 - Getting .local to be resolved..
We have two problems to solve. First we want to build a local dns server to resolve the .local domain. This will allow you to type ping machine-name as opposed to ping ip-address. This is useful and handy. The second problem is that Mac OS doesn't like to have other machines answer to the .local domain. In their eyes that is a reserved name.. Kinda stupid but we'll fix that.
Get the tinydns server up and working. Follow the instructions here.. Use the instructions all the way until you've checked the addresses of your computers. Since we are only publishing internally, we don't care about the rest.. So we will follow the same instructions as above ..
cd /service/dnscache
echo <DNS SERVER> > root/servers/local
chmod 644 root/servers/foo.com
svc -t .
Don't forget when you get done - verify we can get an IP for an internal local name
dnsip <host>.local
Now we need to have the mac actually search .local for DNS queries.. Mac treats .local only as Rendezvous hosts. So no DNS queries ever happen with .local domains. This can be fixed by following the instructions here
Don't forget to test it on the mac!!
OK were done now..