0

I am trying to get leasequery response from dnsmasq server.

This is the content of the /etc/dnsmasq.conf file:

port=0
interface=eth1
bind-interfaces
listen-address=1.0.1.4
dhcp-range=1.0.1.100,1.0.1.122,10m
dhcp-host=00:11:22:33:44:55,1.0.1.101,30m
dhcp-leasefile=/var/lib/dnsmasq/dnsmasq.leases
dhcp-authoritative

The lease file is empty. I started my dnsmasq server with

dnsmasq

The version I am currentl using is 2.82

The pcap I get contains no response: enter image description here

Am I missing something?

EDIT: These are the syslog:

Feb 22 04:55:18  dnsmasq[6260]: started, version 2.82 DNS disabled
Feb 22 04:55:18  dnsmasq[6260]: compile time options: IPv6 GNU-getopt no-DBus no-UBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack ipset auth no-DNSSEC loop-detect inotify dumpfile
Feb 22 04:55:18  dnsmasq[6260]: LOUD WARNING: listening on 1.0.1.4 may accept requests via interfaces other than eth1
Feb 22 04:55:18  dnsmasq[6260]: LOUD WARNING: use --bind-dynamic rather than --bind-interfaces to avoid DNS amplification attacks via these interface(s)
Feb 22 04:55:18  dnsmasq-dhcp[6260]: DHCP, IP range 1.0.1.100 -- 1.0.1.122, lease time 10m
Feb 22 04:55:18  dnsmasq-dhcp[6260]: DHCP, sockets bound exclusively to interface eth1

8
  • Are you using 1.0.1.0/x as your intranet IP address range? If yes, I wouldn't be surprised if that caused problems. It's a public IP range, so any internet-connected system has a route there via the network gateway router. Intranets should use IP addressing from the private IP address ranges, they're reserved for the purpose. Feb 22, 2023 at 10:27
  • I am using private address. ``` eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 1.0.1.4 netmask 255.255.255.0 broadcast 1.0.1.255 inet6 2008::100:104 prefixlen 120 scopeid 0x0<global> inet6 fe80::5054:6ff:fe07:317 prefixlen 64 scopeid 0x20<link> ether 52:54:06:07:03:17 txqueuelen 1000 (Ethernet) RX packets 479 bytes 66128 (64.5 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 156 bytes 18964 (18.5 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 ```
    – rashi
    Feb 22, 2023 at 10:59
  • Sorry but no; 1.0.1.0/24 is not a private address range. It's a public IP range owned by Chinanet. Private IP ranges are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16, they're reserved for intranet use by RFC 1918. While one can use any IP range inside their own network, it's best practice to stick to the private ranges. Using a public IP range in an intranet can in some situations lead to problems. I'm not saying this is such a situation, but I cannot say it is not either. Feb 22, 2023 at 11:07
  • Oh..i didn't know that. Still learning few things about networking. Are you saying that the leasequery should be sent to my private ip and not this public one?
    – rashi
    Feb 22, 2023 at 11:23
  • No worries, friend :-) The message listening on 1.0.1.4 may accept... caught my attention. The intention seems to be that requests should be accepted only from eth1, which I assume is the one serving the intranet. I thought if there's eth0 connected to internet with a public IP address from the ISP and eth1 connected to intranet with a public IP address, the system might listen to requests also on eth0 which (I assume) is not the intention. So I wanted to notify you. I'd change the intranet to a private range ASAP and see whether that affects the issue. Feb 22, 2023 at 11:47

2 Answers 2

0

Message

Feb 22 04:55:18  dnsmasq[6260]: LOUD WARNING: listening on 1.0.1.4 may accept requests via interfaces other than eth1

appears because interface eth1 serving the intranet is configured to provide DHCP service on IP range 1.0.1.0/24, while there's another interface connected to internet. 1.0.1.0/24 is a public IP range, owned by Chinanet, and since the device already has a known route to this IP range, it will listen for DNS requests also in the internet-connected interface.

While theoretically anyone is allowed to use any IP range they wish in their intranet, using public IP addresses can cause unexpected problems. Best practice is to use in the intranet private IP address ranges specified in RFC 1918:

  • 10.0.0.0/8
  • 172.16.0.0/12
  • 192.168.0.0/16

... or their subnetworks.

DHCPLEASEQUERY is DHCPv4 option 53 message value. dnsmasq is a lightweight DHCP server, which supports only a limited set of DHCP options. Option 53 is not supported.

pg1@TREX:~$ dnsmasq --help dhcp
Known DHCP options:
  1 netmask
  2 time-offset
  3 router
  6 dns-server
  7 log-server
  9 lpr-server
 13 boot-file-size
 15 domain-name
 16 swap-server
 17 root-path
 18 extension-path
 19 ip-forward-enable
 20 non-local-source-routing
 21 policy-filter
 22 max-datagram-reassembly
 23 default-ttl
 26 mtu
 27 all-subnets-local
 31 router-discovery
 32 router-solicitation
 33 static-route
 34 trailer-encapsulation
 35 arp-timeout
 36 ethernet-encap
 37 tcp-ttl
 38 tcp-keepalive
 40 nis-domain
 41 nis-server
 42 ntp-server
 44 netbios-ns
 45 netbios-dd
 46 netbios-nodetype
 47 netbios-scope
 48 x-windows-fs
 49 x-windows-dm
 58 T1
 59 T2
 60 vendor-class
 64 nis+-domain
 65 nis+-server
 66 tftp-server
 67 bootfile-name
 68 mobile-ip-home
 69 smtp-server
 70 pop3-server
 71 nntp-server
 74 irc-server
 77 user-class
 80 rapid-commit
 93 client-arch
 94 client-interface-id
 97 client-machine-id
119 domain-search
120 sip-server
121 classless-static-route
125 vendor-id-encap
150 tftp-server-address
255 server-ip-address
0

Try commenting out:

bind-interfaces

in the configuration file.

From https://thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html

-z, --bind-interfaces On systems which support it, dnsmasq binds the wildcard address, even when it is listening on only some interfaces. It then discards requests that it shouldn't reply to. This has the advantage of working even when interfaces come and go and change address. This option forces dnsmasq to really bind only the interfaces it is listening on. About the only time when this is useful is when running another nameserver (or another instance of dnsmasq) on the same machine. Setting this option also enables multiple instances of dnsmasq which provide DHCP service to run in the same machine.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .