[lxc-users] How to check DNS records of containers

Fajar A. Nugraha list at fajar.net
Wed Jun 28 21:16:26 UTC 2017


On Wed, Jun 28, 2017 at 11:12 PM, Adil Baig <simplyadilb at gmail.com> wrote:

> I actually don't have a separate dnsmasq instance running on the host.
>

... and that, is the root cause of your problem.

But just `dig +short devop-tools.lxd` doesn't. Which means the queries are
> not being forwarded to the lxds dnsmasq. I have added a nameserver entry to
> /etc/resolv.conf, but that hasn't helped.
>
>
That's not how you suppose to do that.

/etc/resolv.conf have no concept of "I don't have this domain on my list,
so forward it to the next server", or "forward queries for domain X to
server Y". If the first server responds with "this domain doesn't exists",
then that's what you get.

Which is why you need another DNS server (dnsmasq being the easiest).

Also, from what I've read /etc/resolv.conf this will get overridden on
> reboot, so this isn't a solution that will survive a reboot. Any ideas?
>
>
Follow known-good recipe. It's tested. It works.

On ubuntu, lxd by default requires dnsmasq-base to be installed (which
provides dnsmasq binary). You need to install dnsmasq package, which
provides the configuration needed for the host to use it as DNS resolver
(e.g. your /etc/resolv.conf will then contain only one entry: "nameserver
127.0.0.1")

Changing it to fit your needs is fine, as long as you know what you're
doing. Be aware though that common pitfalls if not configured correctly
includes:
- doesn't work (which is what you get)
- DNS resolv loop, which results in very high CPU usage, while still
doesn't work.

-- 
Fajar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20170629/324cdcca/attachment.html>


More information about the lxc-users mailing list