> I am using NAT on a debian sarge gnu linux box to share a cable
> internet connection. The linux box has two ethernet cards. One (eth0)
> is connected to the cable connection and gets it's connection details
> from my ISP's DHCP server. The other (eth1) is connected to a network
> switch into which I have connected a very simple wireless access
> point. My clients are mostly windows machines with wireless cards.
>
> I have got DHCP to work and it is leasing IP addresses over the
> wireless connection to the clients which is great. However I want the
> clients to automatically get the correct DNS addresses and I am not
> sure what to do or even where to start.
>
> Is DHCP-DNS what I want?
>
> Should I be running my own DNS server (which caches the others?) or
> simply get the clients to use the DNS servers automatically provided
> by my cable company?
Hi Tim. I think the short answer to your question is that you should be
able to configure whatever DHCP server you're using to tell your LAN
clients as part of the DHCP lease process what their DNS servers are.
I have the same setup as you and I use dnsmasq for as a DNS and DHCP
server for my LAN. dnsmasq is both a cacheing DNS forwarder, and a DHCP
server. That means it can do several things for you:
- Act as a DNS server for your LAN. It will resolve queries about LAN
hosts based on whatever information you give it, e.g. /etc/hosts on the
server.
- Forward queries that it doesn't know how to resolve upstream to your
ISP's DNS servers, and return the result to your LAN clients.
- Cache the DNS results from upstream, so the next time your LAN client
asks for the same host address again, it can answer from cache, speeding
up the result, especially if you have a slow external link.
- Act as a DHCP server for your LAN. As part of the DHCP setup, it will
(by default, you can configure it otherwise) tell your LAN clients to
use itself as the DNS server.
This is a pretty efficient setup, and it's pretty easy to configure,
too. Mainly I just read the man page and the example /etc/dnsmasq.conf
file. A few wrinkles:
If you get your external IP address by DHCP, then you have a DHCP
client-- pump, or dhcpd, or whatever-- that is getting the addresses of
your ISP's DNS servers and writing them into /etc/resolv.conf. If you
use dnsmasq as your DNS server, then you should change this:
- /etc/resolv.conf on the server should now contain only
nameserver 127.0.0.1
which will cause clients running on the server to get their name queries
answered by dnsmasq.
- You have to configure your external DHCP client to put the ISP's name
servers into, say, /etc/resolv.dnsmasq instead of /etc/resolv.conf.
- In /etc/dnsmasq.conf, set
resolv-file=/etc/resolv.dnsmasq
so dnsmasq will know where to look for the name server addresses.
Good luck,
Andrew.
--
To reply by email, change "deadspam.com" to "alumni.utexas.net"
|