Discussion:
[Dnsmasq-discuss] Interface-name not injecting name into cache
Eric Hiller
2015-10-28 00:26:30 UTC
Permalink
Hi all, I haven't been able to get interface-name to work, tried toggling
off and on a number of different options to no avail. I am running 2.7.5.

interface-name=hostnamex,eth0

The rest of the options I have on are:

# this tells dnsmasq to never pass short names to the upstream DNS servers.
If the name is not in tdomain-needed
# ignore /etc/hosts file
no-hosts

# dont use resolv.conf, use these nameservers instead
no-resolv
no-poll
server=8.8.8.8
server=8.8.4.4
server=2001:4860:4860::8888
server=2001:4860:4860::8844

# make this the authoritative dhcp server for my network
dhcp-authoritative
domain=xxx.tld
# add domain to all hosts
expand-hosts
cache-size=500
dhcp-range=192.168.10.100,192.168.10.199,12h
dhcp-option=option:router,192.168.10.1
dhcp-option=option6:ntp-server,[2610:20:6f15:15::27]
dhcp-option=option:ntp-server,192.138.141.172


#setup ipv6
enable-ra
ra-param=eth0,high,0,0
dhcp-range=::100,::1ff,constructor:eth0,ra-names


log-queries=extra

If that helps.

Any ideas on this one?
Thanks!
Eric Luehrsen
2015-10-28 00:58:10 UTC
Permalink
This a configuration for a router where eth0.1 and wifi are bridged to br-lan. br-lan is a proper interface as far as dnsmasq is concerned. Also note but not related, it is probably a good idea to use tags. Set a tag for each network range dhcp4 and dhcp6 with options.

#######################################
dhcp-authoritative
domain-needed
no-hosts
localise-queries
read-ethers
bogus-priv
expand-hosts
local-service
dhcp-generate-names
#######################################
cache-size=4000
dns-forward-max=100
dhcp-lease-max=250
domain=lan
server=/lan/
min-port=16384
#######################################
dhcp-leasefile=/tmp/dhcp.leases
resolv-file=/tmp/resolv.conf.auto
addn-hosts=/tmp/hosts
conf-dir=/tmp/dnsmasq.d
#######################################
stop-dns-rebind
conf-file=/usr/share/dnsmasq/trust-anchors.conf
dnssec
dnssec-timestamp=/etc/dnsmasq.time
#######################################
interface-name=routername.lan,br-lan
interface-name=routername,br-lan
interface-name=ipv4.routername.lan,br-lan/4

interface-name=ipv6.routername.lan,br-lan/6

#######################################

dhcp-range=set:lan,192.168.1.100,192.168.1.249,255.255.255.0,8h

dhcp-option=tag:lan,option:ntp-server,0.0.0.0

dhcp-option=tag:lan,252,"\n"

dhcp-range=set:lan6,::1000,::ffff,constructor:br-lan,slaac,ra-names,8h

dhcp-option=tag:lan6,option6:ntp-server,[fd00::]

dhcp-option=tag:lan6,option6:dns-server,[::]

ra-param=br-lan,high,300,3600
no-dhcp-interface=eth0.2
#######################################
enable-ra
quiet-ra
#######################################
Eric Luehrsen
2015-10-28 01:45:39 UTC
Permalink
Someone should correct me if I am wrong, but the key lines are the domain= and server=. This tells dnsmasq to make each host "hostname.lan" aliased with "hostname" and that dnsmasq should resolve all queries that imply the ".lan" domain via DHCP (or SLAAC-NAMES).
domain=lanserver=/lan/

________________________________
From: Eric Luehrsen <***@hotmail.com>
Sent: Tuesday, October 27, 2015 8:58 PM
To: BIZ: DNSMASQ List
Subject: [Dnsmasq-discuss] Interface-name not injecting name into cache

This a configuration for a router where eth0.1 and wifi are bridged to br-lan. br-lan is a proper interface as far as dnsmasq is concerned. Also note but not related, it is probably a good idea to use tags. Set a tag for each network range dhcp4 and dhcp6 with options.

#######################################
dhcp-authoritative
domain-needed
no-hosts
localise-queries
read-ethers
bogus-priv
expand-hosts
local-service
dhcp-generate-names
#######################################
cache-size=4000
dns-forward-max=100
dhcp-lease-max=250
domain=lan
server=/lan/
min-port=16384
#######################################
dhcp-leasefile=/tmp/dhcp.leases
resolv-file=/tmp/resolv.conf.auto
addn-hosts=/tmp/hosts
conf-dir=/tmp/dnsmasq.d
#######################################
stop-dns-rebind
conf-file=/usr/share/dnsmasq/trust-anchors.conf
dnssec
dnssec-timestamp=/etc/dnsmasq.time
#######################################
interface-name=routername.lan,br-lan
interface-name=routername,br-lan
interface-name=ipv4.routername.lan,br-lan/4

interface-name=ipv6.routername.lan,br-lan/6

#######################################

dhcp-range=set:lan,192.168.1.100,192.168.1.249,255.255.255.0,8h

dhcp-option=tag:lan,option:ntp-server,0.0.0.0

dhcp-option=tag:lan,252,"\n"

dhcp-range=set:lan6,::1000,::ffff,constructor:br-lan,slaac,ra-names,8h

dhcp-option=tag:lan6,option6:ntp-server,[fd00::]

dhcp-option=tag:lan6,option6:dns-server,[::]

ra-param=br-lan,high,300,3600
no-dhcp-interface=eth0.2
#######################################
enable-ra
quiet-ra
#######################################
Eric Hiller
2015-11-07 02:08:12 UTC
Permalink
(sorry for that delay, work's been crazy)

I did get it working by using FQDN format `sub.domain.tld` -->

interface-name=sub1.domain.tld,eth0
interface-name=sub2.domain.tld,br0

but just having `single` would never work. I noticed you had `single` as
well as `sub.domain.tld` set does `single` as well as the fully qualified
work?

I do not have domain= set because this DNS server is NOT the authoritative
server for that domain, so I want hosts that do not exist locally to be
queried upstream.

-Eric
Post by Eric Luehrsen
Someone should correct me if I am wrong, but the key lines are the
domain= and server=. This tells dnsmasq to make each host "hostname.lan"
aliased with "hostname" and that dnsmasq should resolve all queries that
imply the ".lan" domain via DHCP (or SLAAC-NAMES).
domain=lanserver=/lan/
------------------------------
*Sent:* Tuesday, October 27, 2015 8:58 PM
*To:* BIZ: DNSMASQ List
*Subject:* [Dnsmasq-discuss] Interface-name not injecting name into cache
This a configuration for a router where eth0.1 and wifi are bridged to
br-lan. br-lan is a proper interface as far as dnsmasq is concerned. Also
note but not related, it is probably a good idea to use tags. Set a tag for
each network range dhcp4 and dhcp6 with options.
#######################################
dhcp-authoritative
domain-needed
no-hosts
localise-queries
read-ethers
bogus-priv
expand-hosts
local-service
dhcp-generate-names
#######################################
cache-size=4000
dns-forward-max=100
dhcp-lease-max=250
domain=lan
server=/lan/
min-port=16384
#######################################
dhcp-leasefile=/tmp/dhcp.leases
resolv-file=/tmp/resolv.conf.auto
addn-hosts=/tmp/hosts
conf-dir=/tmp/dnsmasq.d
#######################################
stop-dns-rebind
conf-file=/usr/share/dnsmasq/trust-anchors.conf
dnssec
dnssec-timestamp=/etc/dnsmasq.time
#######################################
interface-name=routername.lan,br-lan
interface-name=routername,br-lan
interface-name=ipv4.routername.lan,br-lan/4
interface-name=ipv6.routername.lan,br-lan/6
#######################################
dhcp-range=set:lan,192.168.1.100,192.168.1.249,255.255.255.0,8h
dhcp-option=tag:lan,option:ntp-server,0.0.0.0
dhcp-option=tag:lan,252,"\n"
dhcp-range=set:lan6,::1000,::ffff,constructor:br-lan,slaac,ra-names,8h
dhcp-option=tag:lan6,option6:ntp-server,[fd00::]
dhcp-option=tag:lan6,option6:dns-server,[::]
ra-param=br-lan,high,300,3600
no-dhcp-interface=eth0.2
#######################################
enable-ra
quiet-ra
#######################################
_______________________________________________
Dnsmasq-discuss mailing list
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Eric Hiller
2016-03-26 04:03:40 UTC
Permalink
I know this is a bit un-timely. But I wanted to reply so that this
information was publicly available. For what seems an unknown reason to
me, the following will not work->

interface-name=wan,eth0
interface-name=lan,eth1

However this will->

interface-name=wan.domain.tld,eth0
interface-name=wan,eth0
interface-name=lan.domain.tld,eth1
interface-name=lan,eth1

As will this ->

interface-name=wan.domain.tld,eth0
interface-name=wan,eth0
interface-name=lan.domain.tld,eth1
interface-name=lan,eth1
interface-name=lan6,eth1/6
interface-name=lan4,eth1/4

So it appears you must at LEAST have the fqdn listed, then after that you
can have hostname-only as you please.

Hope that helps others.

Thanks
-Eric
Post by Eric Luehrsen
This a configuration for a router where eth0.1 and wifi are bridged to
br-lan. br-lan is a proper interface as far as dnsmasq is concerned. Also
note but not related, it is probably a good idea to use tags. Set a tag for
each network range dhcp4 and dhcp6 with options.
#######################################
dhcp-authoritative
domain-needed
no-hosts
localise-queries
read-ethers
bogus-priv
expand-hosts
local-service
dhcp-generate-names
#######################################
cache-size=4000
dns-forward-max=100
dhcp-lease-max=250
domain=lan
server=/lan/
min-port=16384
#######################################
dhcp-leasefile=/tmp/dhcp.leases
resolv-file=/tmp/resolv.conf.auto
addn-hosts=/tmp/hosts
conf-dir=/tmp/dnsmasq.d
#######################################
stop-dns-rebind
conf-file=/usr/share/dnsmasq/trust-anchors.conf
dnssec
dnssec-timestamp=/etc/dnsmasq.time
#######################################
interface-name=routername.lan,br-lan
interface-name=routername,br-lan
interface-name=ipv4.routername.lan,br-lan/4
interface-name=ipv6.routername.lan,br-lan/6
#######################################
dhcp-range=set:lan,192.168.1.100,192.168.1.249,255.255.255.0,8h
dhcp-option=tag:lan,option:ntp-server,0.0.0.0
dhcp-option=tag:lan,252,"\n"
dhcp-range=set:lan6,::1000,::ffff,constructor:br-lan,slaac,ra-names,8h
dhcp-option=tag:lan6,option6:ntp-server,[fd00::]
dhcp-option=tag:lan6,option6:dns-server,[::]
ra-param=br-lan,high,300,3600
no-dhcp-interface=eth0.2
#######################################
enable-ra
quiet-ra
#######################################
_______________________________________________
Dnsmasq-discuss mailing list
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Leandro Noferini
2016-04-06 20:37:55 UTC
Permalink
Ciao a tutti,

I think my problem is similar to the one from the original post so I use
this thread.

I have a server with dnsmasq (version 2.72-3+deb8u from debian stable)
doing dhcp and dns.

In my dnsmasq.conf I have this line:

dhcp-range=lan,10.150.29.100,10.150.29.249,255.255.255.0,12h

When I try to connect with my laptop with network-manager (version
1.1.93-1 from debian unstable) I get the correct address (the laptop has
a fixed one) but I get this /etc/resolv.conf

# Generated by resolvconf
search cybervalley.orglan
nameserver 10.150.29.2

As you can see the search domain is incorrect.

The other clients, android phones, computer with older network-manager
versions and other OS and whatever does not have this problem.

What could I look for?
--
leandro
Scegli sempre un'idea che ti permetta poi di cambiarla
http://6xukrlqedfabdjrb.onion
Albert ARIBAUD
2016-04-06 21:38:05 UTC
Permalink
Hi LEandro,

Le Wed, 06 Apr 2016 22:37:55 +0200
Post by Leandro Noferini
Ciao a tutti,
I think my problem is similar to the one from the original post so I
use this thread.
I have a server with dnsmasq (version 2.72-3+deb8u from debian stable)
doing dhcp and dns.
dhcp-range=lan,10.150.29.100,10.150.29.249,255.255.255.0,12h
When I try to connect with my laptop with network-manager (version
1.1.93-1 from debian unstable) I get the correct address (the laptop
has a fixed one) but I get this /etc/resolv.conf
# Generated by resolvconf
search cybervalley.orglan
nameserver 10.150.29.2
As you can see the search domain is incorrect.
The other clients, android phones, computer with older network-manager
versions and other OS and whatever does not have this problem.
What could I look for?
Try using --dhcp-option-force to force-send option 119 (domain search)
to the client laptop.

Amicalement,
--
Albert.
Leandro Noferini
2016-04-08 17:09:26 UTC
Permalink
Albert ARIBAUD <***@free.fr> writes:


[...]
Post by Albert ARIBAUD
Post by Leandro Noferini
# Generated by resolvconf
search cybervalley.orglan
nameserver 10.150.29.2
As you can see the search domain is incorrect.
The other clients, android phones, computer with older network-manager
versions and other OS and whatever does not have this problem.
What could I look for?
Try using --dhcp-option-force to force-send option 119 (domain search)
to the client laptop.
Thanks for your answer and please excuse me for the delay.

I wrote a line like this in my /etc/dnsmasq.conf

dhcp-option=119,cybervalley.org

but nothing has changed.

What more could I do?
--
leandro
Scegli sempre un'idea che ti permetta poi di cambiarla
http://6xukrlqedfabdjrb.onion
Albert ARIBAUD
2016-04-08 18:12:37 UTC
Permalink
Bonjour,

Le Fri, 08 Apr 2016 19:09:26 +0200
Post by Leandro Noferini
[...]
Post by Albert ARIBAUD
Post by Leandro Noferini
# Generated by resolvconf
search cybervalley.orglan
nameserver 10.150.29.2
As you can see the search domain is incorrect.
The other clients, android phones, computer with older
network-manager versions and other OS and whatever does not have
this problem.
What could I look for?
Try using --dhcp-option-force to force-send option 119 (domain
search) to the client laptop.
Thanks for your answer and please excuse me for the delay.
I wrote a line like this in my /etc/dnsmasq.conf
dhcp-option=119,cybervalley.org
but nothing has changed.
What more could I do?
What does /etc/resolv.conf contain when the laptop network interface is
down, or better yet, when it never comes up after boot?

Amicalement,
--
Albert.
Leandro Noferini
2016-04-09 17:18:16 UTC
Permalink
This post might be inappropriate. Click to display it.
Albert ARIBAUD
2016-04-10 12:51:56 UTC
Permalink
Bonjour,

Le Sat, 09 Apr 2016 19:18:16 +0200
Post by Leandro Noferini
[...]
Post by Albert ARIBAUD
Post by Leandro Noferini
Post by Albert ARIBAUD
Post by Leandro Noferini
# Generated by resolvconf
search cybervalley.orglan
nameserver 10.150.29.2
[...]
Post by Albert ARIBAUD
Post by Leandro Noferini
Post by Albert ARIBAUD
Try using --dhcp-option-force to force-send option 119 (domain
search) to the client laptop.
Thanks for your answer and please excuse me for the delay.
I wrote a line like this in my /etc/dnsmasq.conf
dhcp-option=119,cybervalley.org
but nothing has changed.
What more could I do?
What does /etc/resolv.conf contain when the laptop network
interface is down, or better yet, when it never comes up after boot?
If I stop network-manager or if I switch off the network adapter
(using the option from network-manager control for gnome3) I get this
# Generated by NetworkManager
search cybervalley.org lan
nameserver 10.150.29.2
Note the space between the real domain and the word lan!
The real same file I get rebooting with the network adapter switched
off.
So it would appear that dnsmasq already sends the right domain search
option, and the issue is indeed with network manager.

Amicalement,
--
Albert.
Leandro Noferini
2016-04-10 19:43:21 UTC
Permalink
Ciao a tutti,

forgiving: thanks a lot for all your help!
--
leandro
Scegli sempre un'idea che ti permetta poi di cambiarla
http://6xukrlqedfabdjrb.onion
Leandro Noferini
2016-04-10 19:42:57 UTC
Permalink
Albert ARIBAUD <***@free.fr> writes:


[...]
Post by Albert ARIBAUD
So it would appear that dnsmasq already sends the right domain search
option, and the issue is indeed with network manager.
So I need to notice about this bug (?) to network-manager team!
--
leandro
Scegli sempre un'idea che ti permetta poi di cambiarla
http://6xukrlqedfabdjrb.onion
Albert ARIBAUD
2016-04-11 07:24:52 UTC
Permalink
Hi Leandro,

Le Sun, 10 Apr 2016 21:42:57 +0200
Post by Leandro Noferini
[...]
Post by Albert ARIBAUD
So it would appear that dnsmasq already sends the right domain
search option, and the issue is indeed with network manager.
So I need to notice about this bug (?) to network-manager team!
Depends: could be a Network manager inherent bug, or a NM configuration
file issue -- in the second case, this is not for the NM team to
handle, but for the distro team.

Amicalement,
--
Albert.
Dan Williams
2016-04-12 16:34:40 UTC
Permalink
Post by Albert ARIBAUD
Hi Leandro,
Le Sun, 10 Apr 2016 21:42:57 +0200
Post by Leandro Noferini
[...]
Post by Albert ARIBAUD
So it would appear that dnsmasq already sends the right domain
search option, and the issue is indeed with network manager.
So I need to notice about this bug (?) to network-manager team!
Depends: could be a Network manager inherent bug, or a NM
configuration
file issue -- in the second case, this is not for the NM team to
handle, but for the distro team.
Turns out this is an openresolv bug present in 3.7.3 that was fixed in
3.8.0.  It does not split multiple search domains.

http://roy.marples.name/projects/openresolv/info/1e6ac67eb3

Dan
Leandro Noferini
2016-04-12 16:54:14 UTC
Permalink
Albert ARIBAUD <***@free.fr> writes:


[...]
Post by Albert ARIBAUD
Post by Leandro Noferini
So I need to notice about this bug (?) to network-manager team!
Depends: could be a Network manager inherent bug, or a NM
configuration file issue -- in the second case, this is not for the NM
team to handle, but for the distro team.
It appears being this openresolv bug
http://roy.marples.name/projects/openresolv/info/1e6ac67eb3

I am going to notice this bug to debian mantainer.

Thanks a lot!
--
leandro
Scegli sempre un'idea che ti permetta poi di cambiarla
http://6xukrlqedfabdjrb.onion
Continue reading on narkive:
Loading...