1

I am using DNSmasq both for my local clients and some internet services. One service I provide is a dynDNS server. It receives IP updates via HTTP and writes it as simple hosts file but without domain. The domain is attached by DNSmasq due to the following minimal config:

interface=eth0          # internal
interface=eth1          # external
no-dhcp-interface=eth1
dhcp-range=192.168.1.2,192.168.1.254,12h

domain=mydomain.eu
no-hosts
addn-hosts=/etc/hosts.dyndns         # hosts file created by my dynDNS server
expand-hosts

# Server/VMs
host-record=server,192.168.1.1
host-record=server.mydomain.eu,<externalIP>
cname=dns.mydomain.eu,server.mydomain.eu
address=/mydomain.eu/<externalIP>    # wildcard subdomains

The problem is: The domain is delivered by DHCP to my local clients, too. If some of it asks for server the client extends its request to the domain server.mydomain.eu which is answered by DNSmasq to be <externalIP>. Due to the topology of my connection to the internet that involves several issues. Instead it should be resolved to 192.168.1.1.

How to make DNSmasq to distinguish between requests from local network and internet? Or is it possible to use domain just for expanding hosts files?

2 Answers 2

1

ISC DHCP server has zones, which could solve your problem, but I doubt that you wish to leave dnsmasq.

But tou can launch two dnsmasq instances with slightly different configs. Internal:

bind-interfaces
interface=eth0          # internal
dhcp-range=192.168.1.2,192.168.1.254,12h

domain=mydomain.eu
no-hosts
addn-hosts=/etc/hosts.dyndns         # hosts file created by my dynDNS server
expand-hosts

# Server/VMs
host-record=server,192.168.1.1
host-record=server.mydomain.eu,192.168.1.1
cname=dns.mydomain.eu,server.mydomain.eu
address=/mydomain.eu/<externalIP>    # wildcard subdomains

and external:

bind-interfaces
interface=eth1          # external

no-hosts
addn-hosts=/etc/hosts.dyndns         # hosts file created by my dynDNS server

# Server/VMs
host-record=server.mydomain.eu,<externalIP>
cname=dns.mydomain.eu,server.mydomain.eu
address=/mydomain.eu/<externalIP>    # wildcard subdomains
-1

If you're able to ping 157.166.224.26 but you are NOT able to ping cnn.com

Then you're having a DNS problem.

[If you are NOT able to ping EITHER, then there are network problems and you have NO problems if you CAN ping BOTH]

You can then use nslookup to locate an alternate internal or external dns server that correctly resolves 'cnn.com' to it's ip address and configure your workstation's NIC for this static dns server until the problems with the DHCP

1
  • Please read the question again carefully. Your answer does not answer the original question.
    – DavidPostill
    Commented Jul 18, 2016 at 17:31

You must log in to answer this question.

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