LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-25-2013, 03:21 PM   #1
keymoo
Member
 
Registered: Jan 2002
Location: UK
Distribution: Desktop - Ubuntu, Server - Debian, CentOS
Posts: 72

Rep: Reputation: 15
dnsmasq not reading ethers file


I am using dnsmasq on my home LAN for dns and dhcp. I have configured some dhcp reservations in /etc/ethers. However dnsmasq is not using the ip addresses from the ethers file. Any ideas why?

My /etc/dnsmasq.conf
Code:
bogus-priv
cache-size=5000
conf-dir=/etc/dnsmasq.d
dhcp-authoritative
dhcp-lease-max=1000
domain-needed
domain=localdomain
expand-hosts
no-negcache
strict-order
user=nobody
domain-suffix=localdomain
local=/localdomain/
bogus-nxdomain=67.215.65.132
log-queries
log-dhcp
My /etc/dnsmasq.d/dhcp.conf file
Code:
dhcp-option=eth0,1,255.255.255.0
dhcp-option=eth0,3,10.0.0.6
dhcp-option=eth0,6,10.0.0.6,208.67.222.222,208.67.220.220
dhcp-option=eth0,15,localdomain
dhcp-option=eth0,28,10.0.0.255
dhcp-range=eth0,10.0.0.50,10.0.0.254,12h
read-ethers
In /var/log/messages I see entries like:
Code:
Sep 25 21:19:37 carbon dnsmasq-dhcp[1537]: 2966085683 Available DHCP range: 10.0.0.50 -- 10.0.0.254
Sep 25 21:19:37 carbon dnsmasq-dhcp[1537]: 2966085683 client provides name: lanthanum
Sep 25 21:19:37 carbon dnsmasq-dhcp[1537]: 2966085683 Vendor class: MSFT 5.0
Sep 25 21:19:37 carbon dnsmasq-dhcp[1537]: 2966085683 DHCPINFORM(eth0) 10.0.0.141 50:e5:49:38:fc:a2
Sep 25 21:19:37 carbon dnsmasq-dhcp[1537]: 2966085683 DHCPACK(eth0) 10.0.0.141 50:e5:49:38:fc:a2 lanthanum
Sep 25 21:19:37 carbon dnsmasq-dhcp[1537]: 2966085683 requested options: 1:netmask, 15:domain-name, 3:router, 6:dns-server,
Sep 25 21:19:37 carbon dnsmasq-dhcp[1537]: 2966085683 requested options: 44:netbios-ns, 46:netbios-nodetype, 47:netbios-scope,
Sep 25 21:19:37 carbon dnsmasq-dhcp[1537]: 2966085683 requested options: 31:router-discovery, 33:static-route, 121:classless-static-route,
Sep 25 21:19:37 carbon dnsmasq-dhcp[1537]: 2966085683 requested options: 249, 43:vendor-encap, 252
Sep 25 21:19:37 carbon dnsmasq-dhcp[1537]: 2966085683 tags: eth0
Sep 25 21:19:37 carbon dnsmasq-dhcp[1537]: 2966085683 next server: 10.0.0.6
Sep 25 21:19:37 carbon dnsmasq-dhcp[1537]: 2966085683 sent size:  1 option: 53:message-type  05
Sep 25 21:19:37 carbon dnsmasq-dhcp[1537]: 2966085683 sent size:  4 option: 54:server-identifier  10.0.0.6
Sep 25 21:19:37 carbon dnsmasq-dhcp[1537]: 2966085683 sent size:  4 option: 51:lease-time  00:00:84:27
Sep 25 21:19:37 carbon dnsmasq-dhcp[1537]: 2966085683 sent size: 11 option: 15:domain-name  localdomain
Sep 25 21:19:37 carbon dnsmasq-dhcp[1537]: 2966085683 sent size: 12 option:  6:dns-server  10.0.0.6, 208.67.222.222, 208.67.220.220
Sep 25 21:19:37 carbon dnsmasq-dhcp[1537]: 2966085683 sent size:  4 option:  3:router  10.0.0.6
Sep 25 21:19:37 carbon dnsmasq-dhcp[1537]: 2966085683 sent size:  4 option:  1:netmask  255.255.255.0
Sep 25 21:20:50 carbon dnsmasq-dhcp[1537]: 269133980 Available DHCP range: 10.0.0.50 -- 10.0.0.254
In ethers I have this entry for that MAC:
Code:
50:e5:49:38:fc:a2 10.0.0.57     # lanthanum
 
Old 09-26-2013, 10:17 AM   #2
keymoo
Member
 
Registered: Jan 2002
Location: UK
Distribution: Desktop - Ubuntu, Server - Debian, CentOS
Posts: 72

Original Poster
Rep: Reputation: 15
I worked it out. If the machine is not also in /etc/hosts it doesn't work. So for anyone struggling with this the MAC address needs to be in /etc/ethers mapped to the IP, and the IP needs to be in /etc/hosts mapped to the name.
 
Old 09-27-2013, 12:22 AM   #3
toothandnail
Member
 
Registered: Apr 2007
Location: Oxfordshire, UK
Distribution: Arch, Sparky, Salix64
Posts: 119

Rep: Reputation: 25
Quote:
Originally Posted by keymoo View Post
I worked it out. If the machine is not also in /etc/hosts it doesn't work. So for anyone struggling with this the MAC address needs to be in /etc/ethers mapped to the IP, and the IP needs to be in /etc/hosts mapped to the name.
I've never tried using a separate file for dhcp resevations. I have this in my servers /etc/dnsmasq.conf:

Code:
expand-hosts
dhcp-range=192.168.1.100,192.168.1.200,12h

dhcp-host=00:01:d2:04:0b:d8,openwrt,192.168.1.2
dhcp-host=00:14:BF:70:9B:36,slug,192.168.1.3
Nothing about either device in /etc/hosts, and they both get the correct IP.

Paul.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Microsoft Visual C++, Reading from File, Reading an XFile not heirarchy Soulkeeper1987 Programming 1 07-01-2012 04:09 PM
Shell programing for ip/mac addition in /etc/ethers file raheelch Programming 1 02-24-2010 01:33 AM
is there a file where dnsmasq stores its cached dns? kublador Linux - Software 0 09-04-2004 07:01 AM
dnsmasq cleaning up leases file TheRealDeal Linux - Networking 0 03-02-2004 11:12 PM
Ethers Table TechnoBod Linux - Networking 1 01-22-2003 05:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration