[lxc-users] Failure to resolve container hostname

Liam Elberty liam.elberty at gmail.com
Tue Jul 15 00:03:55 UTC 2014


Hello all,

I just started playing around with LXC earlier today.

I'm on Ubuntu 12.04.4 LTS, running LXC version 0.7.5-3ubuntu69

I'm using LXC out-of-the-box, which means it's by default using a dnsmasq
server.

If I get a container up and running with:

*lxc-create -t ubuntu -n c1*
*lxc-start -d -n c1*

I cannot resolve the hostname.

*ssh c1 *times out, I cannot *ping c1*, and *host c1 *also fails.

However, I am able to connect through ssh if I grab the ip address directly
by checking dnsmasq's lease:

*cat /var/lib/misc/dnsmasq.leases*

I can add the leased ip to my /etc/hosts and it resolves just fine, but
this is not optimal as it will break as soon as a container gets assigned a
new address.

I'll also note that I tried adding '*dhcp-host=c1,10.0.3.101*' to
/etc/lxc/dnsmasq.conf and restarted the network manager, as well as the
lxc-net service, and this did nothing. The container was still dynamically
assigned an IP.

I've been googling for the better part of the afternoon and figured I'd hit
up the list, as I could not find anything. My networking chops are not the
greatest - I'd say I'm at the high end of novice.

Thanks in advance!

Liam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20140714/eb80d62e/attachment.html>


More information about the lxc-users mailing list