2

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=8.8.8.8

[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 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.

closed as off-topic by Jeff Schaller, Rui F Ribeiro, Anthon, countermode, hildred Jun 19 '17 at 3:37

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Jeff Schaller, Rui F Ribeiro, Anthon, countermode, hildred
If this question can be reworded to fit the rules in the help center, please edit the question.

0

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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.