<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 12px; font-family: Arial, sans-serif;">
<div>
<div>
<div>I’m not entirely sure, but this may have something to do with /var/lib/misc/dnsmasq.lxcbr0.leases .</div>
<div><br>
</div>
<div>Having deleted and re-created the container again, I have noticed that the host name is not listed in the above file and I get the following;</div>
<div><br>
</div>
<div>lxc exec container2 -- nslookup container1</div>
<div>Server:      10.0.3.1</div>
<div>Address:    10.0.3.1#53</div>
<div><br>
</div>
<div>** server can’t find container1: NXDOMAIN</div>
<div><br>
</div>
<div>Should LXD be updating this cache when containers are stopped/started? It is currently full of entries for other containers, but is missing the one that was recently dropped/created. I imagine if I wait a while it will appear.</div>
<div>
<div id="MAC_OUTLOOK_SIGNATURE"></div>
</div>
</div>
</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:12pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>Jamie Brown <<a href="mailto:Jamie.Brown@mpec.co.uk">Jamie.Brown@mpec.co.uk</a>><br>
<span style="font-weight:bold">Date: </span>Friday, 11 March 2016 at 13:56<br>
<span style="font-weight:bold">To: </span>LXC users mailing-list <<a href="mailto:lxc-users@lists.linuxcontainers.org">lxc-users@lists.linuxcontainers.org</a>><br>
<span style="font-weight:bold">Subject: </span>Re: Container to container comms by hostname<br>
</div>
<div><br>
</div>
<div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 12px; font-family: Arial, sans-serif;">
<div>
<div>
<div>Update: After about 5 minutes the hostname suddenly became available to ping from the other containers.</div>
<div><br>
</div>
<div>I guess this is just some sort of DNS caching issue?</div>
<div><br>
</div>
<div>Would still be interested in understanding how people are achieving this.</div>
<div>
<div id=""></div>
</div>
</div>
</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:12pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>Jamie Brown <<a href="mailto:Jamie.Brown@mpec.co.uk">Jamie.Brown@mpec.co.uk</a>><br>
<span style="font-weight:bold">Date: </span>Friday, 11 March 2016 at 13:51<br>
<span style="font-weight:bold">To: </span>LXC users mailing-list <<a href="mailto:lxc-users@lists.linuxcontainers.org">lxc-users@lists.linuxcontainers.org</a>><br>
<span style="font-weight:bold">Subject: </span>Container to container comms by hostname<br>
</div>
<div><br>
</div>
<div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 12px; font-family: Arial, sans-serif;">
<div>
<div>
<div>Hi,</div>
</div>
</div>
<div><br>
</div>
<div>I’m using the default network configuration from LXD with lxcbr0 and 10.0.3.* IP range.</div>
<div><br>
</div>
<div>If I create multiple containers (ubuntu:14.04) then I am able to contact these containers from within each other by hostname.</div>
<div><br>
</div>
<div>e.g.</div>
<div>container1</div>
<div>container2</div>
<div>container3</div>
<div><br>
</div>
<div>Within container2 I can simply run ‘ping container1’ and it manages to resolve the IP without any further configuration.</div>
<div><br>
</div>
<div>However, if I then delete container1 and re-create it, the IP address of container1 may change (via DHCP) and when I try to ping container1 from container2 I simply receive “ping: unknown host container1”.</div>
<div><br>
</div>
<div>I’m not sure what the intended behaviour is here, I was really happy when I realised I could simple communicate between containers by container name (host name), but now I’m not so sure it is a reliable method.</div>
<div><br>
</div>
<div>Could someone outline the intended behaviour here, and perhaps recommend a more reliable way of container to container communication without relying on knowing the IP addresses?</div>
<div><br>
</div>
<div>Thanks,</div>
<div><br>
</div>
<div>Jamie</div>
</div>
</div>
</span></div>
</div>
</span>
</body>
</html>