DHCP, Gateway and home LAN

so, i maintain a small home lan with opensuse 10.3 connected to ISP, 2nd 10.3 and Vista laptop. opensuse connected to ISP is a router for the other 2 system (obviously :D)
i run dhcp server on the router box to provide connection info for the 2nd opensuse and laptop
the router box obtains the ip, dns servers and gateway from isp with dhcp. The problems started a week ago when isp began to supply different ip, dns and gateway; before they were the same all the time.
the question is how to make dhcp server to use the current dns servers and gateway (obtained by dhcp client on the same box) and spread them to the clients?
i can edit by hand the dhcp server config each time but prefer to do not and also when i’am not home the 2 client boxes are running out of internet.

I do understand your frustrations and will try to help you. But I do not understand quite what your ISP does. Does it give you new data on the flight? Or when you login again to your ISP. Even when you login again after a short time (say within a few days) your ISP should give you the same IP address (lease time). When not, I would complain. And is that address in another network? Else the default gateway and the DNS severs are rather stable components inside a network.

But nevertheless. Maybe you cold solve this by a script that you run e.g. after connecting to your ISP (or using cron every … when the changes are realy that dynamic). The script has to get the IP adddress, default gateway and DNS servers from your system and you could then put them in your DHCP config as you do that normally by hand.

For your IP address and netmask do

ifconfig eth0 | grep 'inet addr:'

(for eth0 use the device you use).
For the deafult gateway:

netstat -r | grep default

The DNS servers:

grep nameserver /etc/resolv.conf

Hello Rhaddamant,

If your 10.3 server is a router for the 2 clients then your own router’s internal IP should be the gateway IP that DHCP passes to any clients no matter what gateway the ISP is passing to the server/router itself. Make sense?

As for the DNS issues: A couple possibilities spring to mind that may help.

  1. Use a free public DNS service such as OpenDNS.org – It’s permanent name servers are and You don’t even need to signup, just config DHCP to pass these to your clients as DNS servers and skip using your ISP’s DNS servers at all.

  2. Setup your 10.3 router/server to also be a caching DNS server itself. In this case you would config DHCP to pass the router’s static internal IP as the client’s DNS server.

Hth, let me know if you need more specifics.


i do don’t understand the change in policy but it’s what it’s, could be temporary due to some ISP reorganization, we’ll see. thanks for idea and tips.

yes, actually router’s internal ip is gateway for clients but the question was general for my information and from curiosity.
i didn’t know about public dns servers but also came to idea for local one. i played around for some time & managed to run bind dns server. now, i have the question: i downloaded root servers list and saved it to /var/lib/named/. also set forwarders in yast dns server config page. it seems when forwarders are not set bind is unable to resolve the queries. i thought if root servers list presents bind should be able to resolve without forwarders? is that correct, am i missing any config options?

You don’t need forwarders, just configure it without forwarders. Why do you need to download a new root.hints file? There’s already one in /var/lib/named. The only thing you need to change is the l.root-servers.net which should be now.

hmmm, strange
after i copy root.hint to /etc/name.d/ too it’s working properly…:slight_smile: i guess it has something to do with named configuration script

i downloaded new file because preinstalled was from year 2004

My root.hints has always been in /var/lib/named. But it’s specified in /etc/named.conf and is usually relative to the directory specified in options.


Ken is correct, your caching named server should have worked without explicitly defining forwarders. (That said, I like to define specific forwarders anyway because I prefer to pick DNS servers that I know are close to me for performance) One glitch may be that your ISP blocks requests to DNS servers other than their own – Unusual in my experience but certainly not unheard of.

To know if your ISP blocks requests to external DNS servers, run this from the command line. Post the response if you need help with it.

host opensuse.org

note: you can sub <> with whatever other DNS server you want to try to directly query. so you can learn quickly which ones work and which ones don’t.

Yet another alternative would to run dnsmasq instead of ISC DHCP and BIND. dnsmasq is included with oS10.3 and can provide both DHCP and DNS forwarding to your local net and I think it’ll handle the changing DNS servers automatically as well. (the clients will always see the dnsmasq server as their DNS server, and dnsmasq will in turn forward those DNS requests to whatever DNS servers the dnsmasq server is currently configured to use… in this case the DNS servers it gets from your ISP’s DHCP.

Hope that helps, let us know how it goes.

p.s. I saw right after originally posting this that you and ken had posted again and that things are working for you.