[Dnsmasq-discuss] dns server
Hartmut Krafft
hartmut at mail.ru
Tue Apr 28 19:14:03 BST 2015
Hi,
you should sort out your setup and assign the functions to your machines
so that they don't get in each other's way.
So, you've got the router and the server, and the clients in the LAN.
Let the router's DNS be unknown to the other machines in the LAN. Let
the server be the LAN's DNS and forward queries to the router. To
achieve this, run your LAN DNS and DHCP daemon on the server. Don't try
to persuade the router to use the server's DNS, this will be too
convoluted.
That way, you get
LAN clients -> Server -> Router -> upstream (e.g. Internet Access
Provider's DNS, as set in the router) for DNS and
LAN clients -> Server for DHCP.
And you could also use the server for other things like filtering,
firewall, ad blocking etc., by configuring it as forwarder and gateway.
To achieve this (temporary outages may occur;-)):
On the router, disable DHCP.
On the server machine, configure the LAN interfaces statically and
disable or purge network-manager.
On the server machine, enable DNS and DHCP (i.e. dnsmasq). Set the
upstream DNS to the IP address of the router.
Either configure DHCP to advertise the router as LAN gateway (easier),
or (more complicated) enable IP forwarding and use the server as LAN
gateway (which must then in turn have the router set as gateway).
Advertise the server as LAN DNS.
Then, configure the web server spoofing that was the problem you wanted
to solve in the first place. (Although I'd rather configure a local
name/virtualhost for the web server instead of spoofing the address
IMHO).
As a bonus, you could configure LAN clients in dnsmasq.conf or hosts
file on the server machine so that they won't change IP addresses.
Read the annotations in dnsmasq.conf and you'll find the options
that you'll have to configure.
HTH
Hartmut
More information about the Dnsmasq-discuss
mailing list