What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

server directive in dnsmasq.conf.add being ignored?

Leapo

New Around Here
I want DNS resolution for internaldomain.net, and all sub-domains of internaldomain.net, to be handled by the internal DNS server 192.168.1.20 rather than by the router itself.

I've added the following to dnsmasq.conf.add, which should force resolution of the above domain and sub-domains to take place on the upstream server... and it looks correct, but for some reason isn't functional:
Code:
server=/internaldomain.net/192.168.1.20

What do I need to do to get this working?
 
Have you verified that your line has been correctly added to /etc/dnsmasq.conf? Any errors in the syslog when dnsmasq starts up?
 
Yes, the line shows up in /etc/dnsmasq.conf, and the logs confirm that it loaded the rule:
Code:
Oct  1 17:21:42 dnsmasq[11485]: using nameserver 192.168.1.20#53 for domain internaldomain.net (no DNSSEC)
Oct  1 17:21:42 dnsmasq[11485]: using local addresses only for domain internaldomain.net
Yet, resolution for internaldomain.net by the router fails, while resolution for internaldomain.net by 192.168.1.20 (the server it's supposed to be relaying requests to) works fine.
 
Last edited:
I suggest you enable logging of the DNS requests to see what's happening.
Code:
# killall dnsmasq
# dnsmasq --log-async --log-queries=extra
# tail -f /tmp/syslog.log
 
Just gave that a try, this is all that appears in the logs when attempting to ping internaldomain.net from my PC (192.168.1.53):
Code:
Oct  1 17:34:11 dnsmasq[11759]: 75 192.168.1.53/62829 query[A] internaldomain.net from 192.168.1.53
Oct  1 17:34:11 dnsmasq[11759]: 75 192.168.1.53/62829 config internaldomain.net is NXDOMAIN
Ping fails with "could not find host"
 
Look in dnsmasq.conf for a conflicting statement. I suspect you might have something like:

local=/internaldomain.net/
 
Yup, that exists in the auto-generated portion of the configuration. Looks like it's placed there by the router when you configure a domain.

Any way to have later entries override that?
 
W00t, that did it! Thank you!

Edit: Wait, it works when I run the command manually, and it works when I execute the new postconf script manually, but it doesn't work if I just restart the dnsmasq service... what gives?
 
Last edited:
Edit: Wait, it works when I run the command manually, and it works when I execute the new postconf script manually, but it doesn't work if I just restart the dnsmasq service... what gives?

Make sure dnsmasq.postconf
- is located in /jffs/scripts
- has a shebang as the first line
- has been marked executable with chmod
- has been saved in linux format and not windows format (run dos2unix on the file)
 
Thanks, but I figured out the problem. You can't run dnsmasq commands (such as: dnsmasq --local=/internaldomain/192.168.1.20) directly from the postconf script, you have to call helper.sh to do config file replacements.

All sorted out, thanks again for the help :)
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Back
Top