Michael Werneke wrote:
> I'm trying to (finally) get around to setting up DNS for my internal
> lan and hosting the DNS for my own domains.  I want to use djbdns and
> pretty much understand how the tinydns and dnscache daemons work.  The
> boxes that I am concerned with are (simplified):
> 
> workstation  192.168.10.3 (linux)
> server  192.168.10.9 (linux)
> windows  192.168.10.7 (XP)
> 
> and have non-routable IPs.
> 
> I have a WRT54G that is doing the firewalling, routing and ip forwarding.
> I have dnscache setup on eth0 of workstation.
> Both windows and server use the dnscache in /etc/resolv.conf and the
> windows equivalent.
> I need to setup tinydns on eth0 of server for both internal and
> external requests.
> My questions are: 
> Which ip address goes into /etc/resolve.conf for server and
> workstation to be able to resolve hosts by domains internally? I want
> workstation.mydomain.org and server.mydomain.org to resolve internally
> as well as externally.
> Which ip address goes into the DNS box for windows' ipconfig?
> 
> I know I've asked jhriv about this before, but I think I asked it
> incorrectly last time.
> Any help would be greatly appreciated.

You want to run at least one cache, and one resolver. They both run on
port 53 UDP, so they cannot be on the same interface. They can, however,
be on the same box.

If you have your router route all DNS (UDP port 53) requests to the
server (192.168.10.9), then it can handle all the resolver needs for the
internl and external boxes.

You would want your cache, running on any box you want, I'd recommend
the server, to query the 192.168.10.9-bound resolver about the internal
domain.

To run the cache (dnscache) and resolver (tinydns) on the same box, you
need them on different interfaces. Luckily, linux allows you to take a
physical network port (NIC) and logically bind multiple interfaces to
it, vial aliasing.

Add an alias to server, and call it whatever you like. 192.168.10.10
sounds good to me. Set up your dnscache on that interface, and put
192.168.10.10 in the /etc/resolv.conf of all the systems in that network.

Set up the dnscache to query the tinydns for your internal domain:
# echo 192.168.10.9 > /var/dnscache/root/servers/localdomain.example.org

Replace my exmple domain with your real domain.

If you do not need the resolver (tinydns) to be accessible from the
external world (ie: your DNS is hosted by an external entity, like
granit canyon) then you can put tinydns on the loopback interface
(127.0.0.1) and replace ``192.168.10.9'' with ``127.0.0.1'' in the above
command, and you don't need to create an aliased interface.

The key is that the cache (dnscache) cannot be bound to the same IP
address as the resolver (tinydns) is. That's all.

-john
-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to