[Dnsmasq-discuss] Repeated assignment, ignored dhcp-host, and failed DNS lookup

2012-10-08 Thread Lovelady, Dennis E.
Let me preface by saying that I've been using dnsmasq for a couple of years, 
without known problems until today.

Today, after having been away for a week, I tried to connect with an internal 
server as I've done many, many times, but DNS lookup failed.

So, on the server that's running dnsmasq, I typed (where m1330c is the server 
in question), and the response was:

 Server: 127.0.0.1
 Address: 127.0.0.1#53

 Non-authoritative answer:
 *** Can't find m1330c: No answer

Now, let me point out that m1330c has a wireless interface and a wired 
interface.  And both of these are specified in the dnsmasq.conf with preferred 
addresses, in the format:
dhcp-host=11:22:33:44:55:66,m1330c,192.168.0.6
dhcp-host=11:22:33:44:55:67,m1330cw,192.168.0.7

I get the same nslookup response for m1330cw

Upon review of the messages log, I found that different addresses are being 
assigned (.14 and .15, respectively)... and not only that, but the assignment 
is being made every 50-some seconds.

This has been set-it-and-forget-it for me, and I don't remember a lot of the 
details I went through for the initial configuration, but I do know that it was 
working, and now has stopped, but without configuration changes.  A reboot of 
the server running dnsmasq did not resolve the issue.

There are a few devices on the network.  Three have hard-coded addresses (in 
/etc/hosts), and nslookup shows accurate information for them.  Those with 
DHCP-based addresses all return can't find ... messages.

Final bit of information: It appears that the repeat-ip-serving for m1330c/w 
has been going on for months, but did not seem to impact operation.  But it 
seems to happen only to these two interfaces (a Windows 7 server, but not the 
only one in the net).

To summarize:

nslookup does not return IP address of DHCP-based servers
dhcp-host entries in /etc/dnsmasq.conf are ignored, or at least are not as 
expected
Repeated assignment of IP address to two interfaces

Following are the messages from dnsmasq since time of boot.  What might I be 
missing?

Oct  8 10:46:46 stora-1 dnsmasq[2046]: started, version 2.62 cachesize 150
Oct  8 10:46:46 stora-1 dnsmasq[2046]: compile time options: IPv6 GNU-getopt 
no-DBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack
Oct  8 10:46:46 stora-1 dnsmasq-dhcp[2046]: DHCP, IP range 192.168.0.10 -- 
192.168.0.109, lease time 7d
Oct  8 10:46:46 stora-1 dnsmasq-tftp[2046]: TFTP root is /home/tftpd
Oct  8 10:46:46 stora-1 dnsmasq[2046]: reading /etc/resolv.conf
Oct  8 10:46:46 stora-1 dnsmasq[2046]: using nameserver 65.32.5.112#53
Oct  8 10:46:46 stora-1 dnsmasq[2046]: using nameserver 65.32.5.111#53
Oct  8 10:46:46 stora-1 dnsmasq[2046]: read /etc/hosts - 258 addresses
Oct  8 10:46:58 stora-1 dnsmasq[2046]: reading /etc/resolv.conf
Oct  8 10:46:58 stora-1 dnsmasq[2046]: using nameserver 65.32.5.112#53
Oct  8 10:46:58 stora-1 dnsmasq[2046]: using nameserver 65.32.5.111#53
Oct  8 10:46:58 stora-1 dnsmasq[2046]: ignoring nameserver 127.0.0.1 - local 
interface
Oct  8 10:47:35 stora-1 dnsmasq-dhcp[2046]: DHCPINFORM(eth0) 192.168.0.14 
00:21:9b:cb:e6:dd
Oct  8 10:47:35 stora-1 dnsmasq-dhcp[2046]: DHCPACK(eth0) 192.168.0.14 
00:21:9b:cb:e6:dd M1330C
Oct  8 10:47:35 stora-1 dnsmasq-dhcp[2046]: DHCPINFORM(eth0) 192.168.0.15 
00:21:5c:6a:03:ef
Oct  8 10:47:35 stora-1 dnsmasq-dhcp[2046]: DHCPACK(eth0) 192.168.0.15 
00:21:5c:6a:03:ef m1330cw
Oct  8 10:48:35 stora-1 dnsmasq-dhcp[2046]: DHCPINFORM(eth0) 192.168.0.14 
00:21:9b:cb:e6:dd
Oct  8 10:48:35 stora-1 dnsmasq-dhcp[2046]: DHCPACK(eth0) 192.168.0.14 
00:21:9b:cb:e6:dd M1330C
Oct  8 10:48:36 stora-1 dnsmasq-dhcp[2046]: DHCPINFORM(eth0) 192.168.0.15 
00:21:5c:6a:03:ef
Oct  8 10:48:36 stora-1 dnsmasq-dhcp[2046]: DHCPACK(eth0) 192.168.0.15 
00:21:5c:6a:03:ef m1330cw
Oct  8 10:49:37 stora-1 dnsmasq-dhcp[2046]: DHCPINFORM(eth0) 192.168.0.14 
00:21:9b:cb:e6:dd
Oct  8 10:49:37 stora-1 dnsmasq-dhcp[2046]: DHCPACK(eth0) 192.168.0.14 
00:21:9b:cb:e6:dd M1330C
Oct  8 10:49:37 stora-1 dnsmasq-dhcp[2046]: DHCPINFORM(eth0) 192.168.0.15 
00:21:5c:6a:03:ef
Oct  8 10:49:37 stora-1 dnsmasq-dhcp[2046]: DHCPACK(eth0) 192.168.0.15 
00:21:5c:6a:03:ef m1330cw
Oct  8 10:50:41 stora-1 dnsmasq-dhcp[2046]: DHCPINFORM(eth0) 192.168.0.14 
00:21:9b:cb:e6:dd
Oct  8 10:50:41 stora-1 dnsmasq-dhcp[2046]: DHCPACK(eth0) 192.168.0.14 
00:21:9b:cb:e6:dd M1330C
Oct  8 10:50:41 stora-1 dnsmasq-dhcp[2046]: DHCPINFORM(eth0) 192.168.0.15 
00:21:5c:6a:03:ef
Oct  8 10:50:41 stora-1 dnsmasq-dhcp[2046]: DHCPACK(eth0) 192.168.0.15 
00:21:5c:6a:03:ef m1330cw
Oct  8 10:51:42 stora-1 dnsmasq-dhcp[2046]: DHCPINFORM(eth0) 192.168.0.14 
00:21:9b:cb:e6:dd
Oct  8 10:51:42 stora-1 dnsmasq-dhcp[2046]: DHCPACK(eth0) 192.168.0.14 
00:21:9b:cb:e6:dd M1330C
Oct  8 10:51:42 stora-1 dnsmasq-dhcp[2046]: DHCPINFORM(eth0) 192.168.0.15 
00:21:5c:6a:03:ef
Oct  8 10:51:42 stora-1 dnsmasq-dhcp[2046]: DHCPACK(eth0) 192.168.0.15 
00:21:5c:6a:03:ef m1330cw
Oct  8 10:53:35 stora-1 dnsmasq-dhcp[2046]: DHCPINFORM(eth0) 192.168.0.14 

Re: [Dnsmasq-discuss] Repeated assignment, ignored dhcp-host, and failed DNS lookup

2012-10-08 Thread Lovelady, Dennis E.
Hi, Simon:

I have all the logs going back to June, 2011.  (That represents about 70,000 
lines of dnsmasq-related messages.)  What would you like to see from those?

The m1330c/w system was on a different network yesterday morning, and moved 
back to this network in the evening.  Absolutely possible that it is hanging on 
to its prior lease, though I didn't think those survived a boot after a network 
switch.  You would absolutely know, though, and I take it from your response 
that that's probably what happened.  I'll refresh the lease this PM if not back 
to normal by then.

How would I know if a rogue DHCP server has appeared on the net?  I'm assuming 
you're on the right track since the answer to the remaining question is:

/var/lib/misc/dnsmasq.leases is empty

Dennis


-Original Message-
From: dnsmasq-discuss-boun...@lists.thekelleys.org.uk 
[mailto:dnsmasq-discuss-boun...@lists.thekelleys.org.uk] On Behalf Of Simon 
Kelley
Sent: Monday, October 08, 2012 12:04 PM
To: dnsmasq-discuss@lists.thekelleys.org.uk
Subject: Re: [Dnsmasq-discuss] Repeated assignment, ignored dhcp-host, and 
failed DNS lookup

On 08/10/12 16:43, Lovelady, Dennis E. wrote:

 To summarize:
 
 nslookup does not return IP address of DHCP-based servers
 
 dhcp-host entries in /etc/dnsmasq.conf are ignored, or at least are 
 not as expected
 
 Repeated assignment of IP address to two interfaces
 
  
 
 Following are the messages from dnsmasq since time of boot.  What 
 might I be missing?
 

The log is expected, and not necessarily a problem. The DHCPINFORM transaction 
is the host asking for configuration information, which dnsmasq supplies in the 
DHCPACK. It's possible for dnsmasq to reply to DHCPINFORM messages even if a 
host doesn't actually have a DHCP lease with it.


Questions:

Are there leases for .0.14 and .0.15 in the dnsmasq leases file?

Is there any way to get logs going further back?

Is there any chance that a rogue DHCP server has turned up on your network?

Has the host in question been attached to another network where it could have 
picked up a different DHCP lease?

My guess is that the .14 and .15 leases don't exist in dnsmasq and the host has 
picked them up elsewhere.

by now, the DHCP leases on .0.14 and .0.15 may have expired, and the host will 
fail to renew them and cycle through the DHCP process, getting the correct 
addresses. If not then taking the interfaces down and then back up, or 
rebooting the host, should do that.


Cheers,

Simon.




___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
BR_
FONT size=2BR
DTCC DISCLAIMER: This email and any files transmitted with it are
confidential and intended solely for the use of the individual or
entity to whom they are addressed. If you have received this email
in error, please notify us immediately and delete the email and any
attachments from your system. The recipient should check this email
and any attachments for the presence of viruses.  The company
accepts no liability for any damage caused by any virus transmitted
by this email./FONT

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


[Dnsmasq-discuss] How to add local configuration to Network Manager initiated dnsmasq in Ubuntu 12.04

2012-10-08 Thread Chris Green
I have run dnsmasq with local configuration for quite a while now to
provide local DNS services on my home LAN.

I am now upgrading my machines to [xl]ubuntu 12.04 and in this version
dnsmasq is run automatically by Network Manager.  A default installation
just puts the following in resolv.conf:-

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by 
resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.0.1

How can I customize the dnsmasq configuration in a way that won't get
broken by future upgrades?  The NM dnsmasq runs as follows:-

chris$ ps -ef | grep dnsmasq
nobody1341  1090  0 17:40 ?00:00:00 /usr/sbin/dnsmasq 
--no-resolv --keep-in-foreground --no-hosts --bind-interfaces 
--pid-file=/var/run/sendsigs.omit.d/network-manager.dnsmasq.pid 
--listen-address=127.0.0.1 --conf-file=/var/run/nm-dns-dnsmasq.conf 
--cache-size=0 --proxy-dnssec

Since the config file is specified as --conf-file=/var/run/nm-dns-dnsmasq.conf
it's difficult to do anything that won't get lost at upgrade time.

-- 
Chris Green

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Repeated assignment, ignored dhcp-host, and failed DNS lookup

2012-10-08 Thread richardvo...@gmail.com
 How would I know if a rogue DHCP server has appeared on the net?  I'm
 assuming you're on the right track since the answer to the remaining
 question is:


You can do a packet capture on the computer getting the wrong addresses
(use wireshark for example) while running

ipconfig /renew

Look at the source MAC address of the DHCPOFFER packets and compare to the
MAC address of your dnsmasq computer's NIC.
___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Repeated assignment, ignored dhcp-host, and failed DNS lookup

2012-10-08 Thread Simon Kelley

On 08/10/12 17:30, Lovelady, Dennis E. wrote:

Hi, Simon:

I have all the logs going back to June, 2011.  (That represents about
70,000 lines of dnsmasq-related messages.)  What would you like to
see from those?

The m1330c/w system was on a different network yesterday morning, and
moved back to this network in the evening.  Absolutely possible that
it is hanging on to its prior lease, though I didn't think those
survived a boot after a network switch.  You would absolutely know,
though, and I take it from your response that that's probably what
happened.  I'll refresh the lease this PM if not back to normal by
then.


A lease will survive a client reboot, but I'd expect a reboot to cause a 
system to at least confirm a lease. Could you look through your dnsmasq 
logs to see what, if anything dnsmasq logged about this machine when it 
booted up on this network?




How would I know if a rogue DHCP server has appeared on the net?  I'm
assuming you're on the right track since the answer to the remaining
question is:


I don't think it's likely, at the moment. My guess is that the DHCP 
server is at the same IP address on both the networks, and when the 
machine came back up, it sent the DHCPINFORM to the DHCP server address, 
then took the response as confirmation that the lease was still valid. 
This is a bit of a gray area, but the client isn't strictly allowed to 
do that: it should send a DHCPREQUEST. (strictly, it should entry 
INIT-REBOOT state)





/var/lib/misc/dnsmasq.leases is empty


That makes sense: dnsmasq will still reply to DHCPINFORM without a 
lease, and the DHCPINFORM won't create a lease. Once the lease expires 
at the client end, or you force it too, then stuff should re-sync.



If rebooting the client caused it to send only DHCPINFORM requests, then 
we have some grounds to complain to Microsoft.



Simon.

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


[Dnsmasq-discuss] Trivial error in sample dnsmasq.conf file

2012-10-08 Thread brendlerjg
I believe the line:

 #dhcp-boot=net:red,pxelinux.red-net

should be

 #dhcp-boot=tag:red,pxelinux.red-net


And, since I have noticed someone has gone to the trouble of fixing
other minor typos:

 # Include a another lot of configuration options.

should be

 # Include another lot of configuration options.

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] How to add local configuration to Network Manager initiated dnsmasq in Ubuntu 12.04

2012-10-08 Thread Jay Imerman
Did you edit /etc/NetworkManager/NetworkManager.conf?  The line should
say dns=dnsmasq




- Jay
Sent from my iPhone

On Oct 8, 2012, at 14:04, Chris Green c...@isbd.net wrote:

 I have run dnsmasq with local configuration for quite a while now to
 provide local DNS services on my home LAN.

 I am now upgrading my machines to [xl]ubuntu 12.04 and in this version
 dnsmasq is run automatically by Network Manager.  A default installation
 just puts the following in resolv.conf:-

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by 
 resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.0.1

 How can I customize the dnsmasq configuration in a way that won't get
 broken by future upgrades?  The NM dnsmasq runs as follows:-

chris$ ps -ef | grep dnsmasq
nobody1341  1090  0 17:40 ?00:00:00 /usr/sbin/dnsmasq 
 --no-resolv --keep-in-foreground --no-hosts --bind-interfaces 
 --pid-file=/var/run/sendsigs.omit.d/network-manager.dnsmasq.pid 
 --listen-address=127.0.0.1 --conf-file=/var/run/nm-dns-dnsmasq.conf 
 --cache-size=0 --proxy-dnssec

 Since the config file is specified as 
 --conf-file=/var/run/nm-dns-dnsmasq.conf
 it's difficult to do anything that won't get lost at upgrade time.

 --
 Chris Green

 ___
 Dnsmasq-discuss mailing list
 Dnsmasq-discuss@lists.thekelleys.org.uk
 http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss