Docker cannot resolve DNS on private network
<p>My machine is on a private network with private DNS servers, and a private zone for DNS resolution. I can resolve hosts on this zone from my host machine, but I cannot resolve them from containers running on my host machine. </p>

<p><strong>Host</strong>:</p>

<pre><code>root@host:~# cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.1.1

root@host:~# ping privatedomain.io
PING privatedomain.io (192.168.0.101) 56(84) bytes of data.
</code></pre>

<p><strong>Container</strong>:</p>

<pre><code>root@container:~# cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN

nameserver 8.8.8.8
nameserver 8.8.4.4

root@container:~# ping privatedomain.io
ping: unknown host privatedomain.io
</code></pre>

<p>It's fairly obvious that Google's public DNS servers won't resolve my private DNS requests. I know I can force it with <code>docker --dns 192.168.0.1</code>, or set <code>DOCKER_OPTS="--dns 192.168.0.1"</code> in <code>/etc/default/docker</code>, but my laptop frequently switches networks. It seems like there should be a systematic way of solving this problem. </p>