You are not logged in.

#1 2017-04-04 17:52:59

theking2
Banned
From: Romanshorn Switzerland
Registered: 2009-03-04
Posts: 372

[SOLVED] dnsmasq hostsfile

Hi

I've configured dnsmasq to have a hostsfile with all fixed (server) IP-addresses in it. I assumed that when an IP address is in the file configure with the hostfile the IP address will be reserved (documentation is a bit dodgy on this) but I found out that an IP address in the range (192.168.111.8) was happily but unwantedly, assigned to a new host. The server in question was turned off.

This is dnsmasq.hosts.conf:

D8:67:D9:D2:4A:C2,saturn,       192.168.111.001,infinite
00:1B:A9:2D:C3:96,enceladus,    192.168.111.005,infinite
00:27:0E:08:17:26,janus,        192.168.111.008,infinite
00:08:9b:ea:79:75,daphnis,      192.168.111.010,infinite
52:54:00:41:59:53,helene,       192.168,111,011,infinite
00:23:f8:2c:ae:a3,atlas,        192.168.111.030,infinite
52:54:00:41:59:53,helene,       192.168.111.011,infinite

Included in dnsmasq.conf with:

dhcp-hostsfile=/etc/dnsmasq.hosts.conf

Last edited by theking2 (2017-04-09 19:28:22)


archlinux on a Gigabyte C1037UN-EU, 16GiB
a Promise  PDC40718 based ZFS set
root on a Samsung SSD PB22-J
running LogitechMediaServer(-git), Samba, MiniDLNA, TOR

Offline

#2 2017-04-05 14:36:58

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,892

Re: [SOLVED] dnsmasq hostsfile

I'm not sure whether the whitespaces are allowed/sane/legal. Does it work if you add

dhcp-host=D8:67:D9:D2:4A:C2,saturn,192.168.111.1,infinite
...

right into the main config?

If not, please share your /etc/dnsmasq.conf (or the file you're passing as --conf-file=/path/to/where)

Offline

#3 2017-04-05 16:07:00

Gosi
Member
From: Vienna, Austria
Registered: 2010-02-25
Posts: 103

Re: [SOLVED] dnsmasq hostsfile

According to the man page the order might be wrong
--dhcp-host=[<hwaddr>][,id:<client_id>|*][,set:<tag>][,<ipaddr>][,<hostname>][,<lease_time>][,ignore]

so it should be:
D8:67:D9:D2:4A:C2      ,192.168.111.001,saturn,infinite

Offline

#4 2017-04-05 16:57:28

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,892

Re: [SOLVED] dnsmasq hostsfile

The order should™ not matter - I've plenty of MAC,hostname,IP,lease here as well and "--dhcp-host=lap,192.168.0.199" is an example in the manpage, but certainly worth a shot.

Another thing that could be troublesome is the double entry for "helene" - you may also check the journal, dnsmasq should log config errors.

Offline

Board footer

Powered by FluxBB