I have a DHCP server which also has a dns server installed, dnsmasq. My current dnsmasq.conf is as follows:domain-neededbogus-privfilterwin2kaddress=/gateway.gw/192.168.10.1interface=eth1bind-interfacesI am using systemd as my network manager which has the following configuration:[Match]Name=eth1[Network]DHCPServer=yesDNS=192.168.10.1DNS=8.8.8.8[Address]Address=192.168.10.1/24Broadcast=192.168.10.255[DHCPServer]PoolOffset=110PoolSize=20EmitDNS=yesThere 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 8.8.8.8. Thus, without explicitly setting gateway as a DNS server, clients cannot use domain name gateway.gw. I have been trying again and again while preparing this question and realized that sometimes it doesn't even send 8.8.8.8 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.
DHCP server does not send all DNS servers in DHCP offer
systemd;dhcp;dnsmasq
I run into a dhcp server configuration for systemd and this guy who wrote it used [DhcpServer] section for adding dns servers. I was using [Network] section since this manual lists it under that section. Turns out, though, that listing DNS servers under DhcpServer section does solve the problem.Note: Manual in the link is also correct. I read it carefully and it says one should write down dns servers to hand out to clients in the corresponding section.