I'm tearing my hair out trying to setup dnsmasq. I'd like to be able to resolve certain local domains (just as a test) to my own machine, and forward the rest to my regular DHCP nameserver that's coming from campus. I'm running Ubuntu 20.04.

Here's what I need from dnsmasq:

  • A wildcard resolver to some local test domain.
  • Full compatibility with forwarding to my existing campus nameserver. I.e. I want 'search' from /etc/resolv.conf to still work, so 'neon' resolves to 'neon.cs.princeton.edu' as usual. I have been unable to even find the IP address of my campus nameserver, let alone keep 'search' working.

In your dnsmasq conf file add these lines to forward specific domains to different IPs.


And this line to forward to your 'campus nameserver'


If you don't have these two things working yet (forward domain, and forward all else), troubleshoot until you get this piece working.

Once that works, start testing the search domains after that.

  • I eventually got it working, thanks! Not sure if this is the cleanest way, but I changed resolv.conf to use nameserver, and set the falll-through for dnsmasq to, so both systems are still running.
    – rosstex
    May 6 '20 at 3:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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