6

How can I forward configure my local dnsmasq so requests with hostnames ending with .docker are forwarded to another nameserver, while other requests are still handled locally ?

I have looked for an /etc/dnsmasq.conf file on my system but could not find it (only a dnsmasq.d directory).

EDIT : apparently, dnsmasq is run by network manager, like this :

/usr/sbin/dnsmasq --no-resolv --keep-in-foreground
--no-hosts --bind-interfaces
--pid-file=/run/sendsigs.omit.d/network-manager.dnsmasq.pid
--listen-address=127.0.1.1
--conf-file=/var/run/NetworkManager/dnsmasq.conf
--cache-size=0 --proxy-dnssec
--enable-dbus=org.freedesktop.NetworkManager.dnsmasq
--conf-dir=/etc/NetworkManager/dnsmasq.d
7

In dnsmasq.conf

server=/docker/10.1.1.1

This would forward all requests looking for TLD .docker to 10.1.1.1. Not sure why your dnsmasq.conf is missing. What distribution are you using?

  • I think I know why : I'm using ubuntu, and dnsmasq is started by network manager. There also is a /etc/NetworkManager/dnsmasq.d directory used in the dnsmasq command. I edited my question to show the command. – greg0ire Aug 5 '15 at 12:58
  • Putting a file named "docker" with this in this directory seems to work when I kill dnsmasq and run it again by hand. I'm going to try a reboot to see if if works after reboot. – greg0ire Aug 5 '15 at 13:03
  • Also: askubuntu.com/questions/155716/… – duenni Aug 5 '15 at 13:04

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.