Re: Does DNSMasq (or other DNS/DHCP Servers) Cache Old Addresses?



On Tue, Mar 3, 2009 at 8:56 AM, Hal Vaughan <hal@xxxxxxxxxxx> wrote:
I'm adding a new system to my LAN.  The DNS is running DNSMasq and is on
Etch.  The new system is running Lenny.  I edited the
/etc/network/interfaces file to include the following (other than loopback,
the only interface in the file):

auto eth0
iface eth0 inet static
address 172.16.7.111
netmask 255.255.0.0
gateway 172.16.7.1

Originally, when Debian set up the system, it used DHCP instead of a static
IP.  This IP address (172.16.7.111) is defined on the DNS server in
/etc/hosts (which DNSMasq uses for config).  When Debian-Lenny set this up
under DHCP, it was assigned the address 172.16.7.131.  I edited the
interfaces file to include the above.  If I did "/etc/init.d/networking
restart," then it would again get the ...131 address.  If I did "ifup eth0"
(after doing ifdown first), then it'd get the 111 address it should have,
but in at least one case, a few minutes later I checked and it was back to
131.

I finally shut down the new system and rebooted the DNS server -- after
having shut off networking on the new system and restarting DNSMasq on the
DNS.  Then I brought up the DNS server, and after that, brought up the new
system.  Now it's working and it finally let me define eth0:0 as well (which
it kept choking on before).

So why did it keep getting forced to use the 172.16.7.131 address instead of
the one ending in 111?  Did DNSMasq cache the MAC address or did the new
workstation cache the info and reuse it automatically?  What was it that the
reboot would have restarted that would allow this system to finally get the
specified address after the reboot?

There's no problem with the server - and techincally no *configuration*
problem with the client. It is the norm for a DHCP server to give the same
address every time to a given machine unless there is a particular reason
not to, so if the client makes a DHCP request then it will get its
preferred dynamic IP (off the top of my head I don't recall whether this
is because the client requests it or because the server stores the MAC
address, but it's definitely the usual behaviour). The question then is
why the client was asking for a dynamic IP address when it had a static
address configured, and the answer is probably as follows:

You changed /etc/network/interfaces, and then did /etc/init.d/networking
restart, yes? In this case, you had a DHCP client running, then switched
to static configuration. Restarting networking causes the interfaces
defined to be brought down, but because you had changed it, there were no
DHCP interfaces defined, so dhclient was never stopped. The static
interface was then brought up correctly, but the dhclient still running
would periodically make a DHCP request and overwrite it. Killing dhclient
would have solved your problem, or obviously rebooting, as you found.

Nye


--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx
with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx



Relevant Pages

  • Re: DNS problems going out
    ... > You enable the DNS server on both interfaces from the DNS Server ... > between your LAN and the Internet? ... > 2) Do you have a valid IP address on the external interface? ... >> Original Client IP Client Agent Authenticated Client Service Server Name ...
    (microsoft.public.isa)
  • DHCP offer ignored - Ethereal trace
    ... At approximately 75 seconds the XP Pro DHCP client broadcasts Discover messages ... The client does not respond for either interface with the expected ...
    (microsoft.public.win32.programmer.networks)
  • Re: DNS problems going out
    ... You enable the DNS server on both interfaces from the DNS Server management ... between your LAN and the Internet? ... Do you have a valid IP address on the external interface? ... > Original Client IP Client Agent Authenticated Client Service Server Name ...
    (microsoft.public.isa)
  • Re: repost: routing and remote access - why no dhcp options
    ... > VPN clients not receiving DHCP options. ... >> connection between a client and an RRAS server, ... >> interface routing connection on another machine running server 2003. ...
    (microsoft.public.windows.server.networking)
  • Re: Preferred DNS now needs to be configured on every client!!!
    ... the the DNS settings to each client through DHCP ... (pointing the client to the intended DNS server)? ... DNS server is configured or not. ...
    (microsoft.public.windows.server.dns)