8

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
greg0ire
  • 316
  • 1
  • 7
  • 26

1 Answers1

10

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?

duenni
  • 2,959
  • 1
  • 23
  • 38
  • 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 05 '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 05 '15 at 13:03
  • Also: http://askubuntu.com/questions/155716/configuring-the-dnsmasq-instance-started-by-connection-sharing-in-networkmanager – duenni Aug 05 '15 at 13:04