1
On Ubuntu 16.04 server edition, after launching an LXC container, it can only be referred to by its IP address. Enabling the .lxc domain in dnsmasq doesn't seem to help, and tutorials available only seem to work for Ubuntu 14.04.
Not being able to use DNS names on the host is a major inconvenience.
From blog posts I gather LXD 2.9 solves some DNS problems, but it seems unclear how to install via PPA.
Steps to reproduce
Following instructions https://gauvain.pocentek.net/name-resolution-lxc-containers.html
- installed
dnsmasq
- uncommented
LXC_DOMAIN="lxc"
in/etc/default/lxc-net
- added
server=/lxc/10.0.3.1
to/etc/dnsmasq.d/lxc
- checked that
/etc/resolv.conf
contains DNS server 10.0.3.1
With sudo lsof -i :53
I checked that lxd
, dnsmasq
and lxc-dnsmasq
seem to be bound to port 53.
However,
- Querying dig mycontainer.lxc
leads no results.
- Querying dig @10.0.3.1 mycontainer.lxc
leads no results.
- Querying dig @10.0.3.1 google.com
produces correct results.