Modify

Opened 6 years ago

Last modified 2 years ago

#10285 new defect

local domain name not appended to static lease hostnames

Reported by: kralikba@… Owned by: developers
Priority: normal Milestone: Barrier Breaker 14.07
Component: packages Version: Trunk
Keywords: dnsmasq expand-hosts static-lease Cc:

Description

I have configured dnsmasq to use static leases for some of the hosts on my network; I have configured a domain name and enabled the expand-hosts option.

Hosts get correct IP-addresses. Local queries on other boxes on the network work.

Local queries without a full domain name do not work for the static leases on the router. They, however, work for the dynamic ones.

ex.: (names altered/actual config file truncated to protect the guilty)

The config file:

root@OpenWRT:~# cat /etc/config/dhcp

config 'dnsmasq'
        option 'domainneeded' '1'
        option 'boguspriv' '1'
        option 'localise_queries' '1'
        option 'rebind_protection' '1'
        option 'rebind_localhost' '1'
        option 'expandhosts' '1'
        option 'authoritative' '1'
        option 'readethers' '1'
        option 'leasefile' '/tmp/dhcp.leases'
        option 'resolvfile' '/tmp/resolv.conf.auto'
        option 'nonegcache' '1'
        option 'domain' 'example.net'
        option 'local' '/example.net/'

config 'dhcp' 'lan'
        option 'interface' 'lan'
        option 'start' '100'
        option 'limit' '150'
        option 'leasetime' '21d'
        option 'ignore' '0'

config 'dhcp' 'wan'
        option 'interface' 'wan'
        option 'ignore' '1'
        option 'dynamicdhcp' '0'

config 'host'
        option 'name' 'dbox'
        option 'mac' '00:82:ef:aa:10:33'
        option 'ip' '192.168.0.103'

Lookup for static lease:

root@OpenWRT:~# ping dbox
ping: bad address 'dbox'
root@OpenWRT:~# nslookup dbox
Server:    127.0.0.1
Address 1: 127.0.0.1 localhost

nslookup: can't resolve 'dbox': Name or service not known
root@OpenWRT:~# nslookup dbox.example.net
Server:    127.0.0.1
Address 1: 127.0.0.1 localhost

Name:      dbox.example.net
Address 1: 192.168.0.103 dbox.example.net

Dynamic lease:

root@OpenWRT:~# cat/tmp/dhcp.leases
1321440213 03:1e:d1:94:24:ae 192.168.0.186 xyzzy 03:1e:d1:94:24:ae
root@OpenWRT:~# ping xyzzy
PING xyzzy(192.168.0.186): 56 data bytes
^C
root@OpenWRT:~# nslookup xyzzy 
Server:    127.0.0.1
Address 1: 127.0.0.1 localhost

Name:      ez
Address 1: 192.168.0.186 xyzzy.example.net
root@OpenWRT:~#

Attachments (0)

Change History (5)

comment:1 Changed 6 years ago by jow

dnsmasq only makes static lease names avaialble if the corresponding address is also leased out (means your dbox did request dhcp sometime since the router was booted). Is this the case here?

comment:2 Changed 6 years ago by kralikba@…

No, this is not necessarily the case. The router may reboot independently from the hosts.

Thanks, I didn't know that.

Someone please close the case.

comment:3 Changed 6 years ago by Ryan.Melena@…

Is this considered a bug or a feature? It would be nice for the router to successfully serve DNS for static leases even if the client hasn't requested DHCP since router reboot. Is there a work-around? Perhaps a script that syncs the static lease entries to /etc/hosts or some such?

comment:4 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as new .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.