I have a DHCP server which also has a dns server installed, dnsmasq. My current dnsmasq.conf is as follows:
domain-needed bogus-priv filterwin2k address=/gateway.gw/192.168.10.1 interface=eth1 bind-interfaces
I am using systemd as my network manager which has the following configuration:
[Match] Name=eth1 [Network] DHCPServer=yes DNS=192.168.10.1 DNS=22.214.171.124 [Address] Address=192.168.10.1/24 Broadcast=192.168.10.255 [DHCPServer] PoolOffset=110 PoolSize=20 EmitDNS=yes
There is a web server running on the same machine as dhcp server and I want dhcp clients to be able to query
gateway.gw to reach this web server, without changing any configuration. Problem is that DHCP server does not send its IP in DNS list, yet it sends 126.96.36.199. Thus, without explicitly setting gateway as a DNS server, clients cannot use domain name
I have been trying again and again while preparing this question and realized that sometimes it doesn't even send
188.8.131.52 in DNS list and I have no idea what happens here and why, being illiterate in networks.
bonus question -> Configuration file of dhcp server is actually configurable via
gateway.gw, one can change its IP address (please don't ask why!:). Is there a way to tell dnsmasq to use IP address of eth1 (to dynamically look it up) to match
gateway.gw, instead of hard-coding it.
Note: I cannot use dnsmasq's builtin dhcp server. My web server actually configures all other network interfaces as well and I don't want to write additional code for one interface.