<div dir="ltr">This hasn't worked for me.<div><br></div><div><div>lxc network show lxdbr0 </div><div>description: ""</div><div>config:</div><div> dns.domain: lxd</div><div> dns.mode: managed</div><div> ipv4.address: <a href="http://10.0.1.1/24">10.0.1.1/24</a></div><div> ipv4.dhcp.ranges: 10.0.1.2-10.0.1.254</div><div> ipv4.nat: "true"</div><div> ipv6.address: none</div><div> raw.dnsmasq: conf-file=/home/ubuntu/stockopedia-lxd-dnsmasq.conf</div><div>name: lxdbr0</div><div>type: bridge</div><div>used_by:</div><div>- /1.0/containers/devop-tools</div><div>- /1.0/containers/polished-thrush</div><div>- /1.0/containers/python-live</div><div>- /1.0/containers/python-staging</div><div>- /1.0/containers/symfony-cli</div><div>- /1.0/containers/symfony-cli-movements</div><div>- /1.0/containers/symfony-cli-staging</div><div>managed: true</div></div><div><br></div><div>I did steps 1.2 and 5. The rest were already in place (lxc version 2.14). I killed dnsmasq and restarted lxd service (sudo service lxd restart) .</div><div><br></div><div>Still no luck.</div><div><br></div><div><div>+-----------------------+---------+-------------------+------+------------+-----------+</div><div>| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |</div><div>+-----------------------+---------+-------------------+------+------------+-----------+</div><div>| devop-tools | RUNNING | 10.0.1.66 (eth0) | | PERSISTENT | 0 |</div><div>+-----------------------+---------+-------------------+------+------------+-----------+</div><div>| polished-thrush | RUNNING | 10.0.1.55 (eth0) | | PERSISTENT | 0 |</div><div>+-----------------------+---------+-------------------+------+------------+-----------+</div><div>| python-live | RUNNING | 10.0.1.52 (eth0) | | PERSISTENT | 0 |</div><div>+-----------------------+---------+-------------------+------+------------+-----------+</div><div>| python-staging | RUNNING | 10.0.1.61 (eth0) | | PERSISTENT | 0 |</div><div>+-----------------------+---------+-------------------+------+------------+-----------+</div><div>| symfony-cli | RUNNING | 10.0.1.2 (eth0) | | PERSISTENT | 1 |</div><div>+-----------------------+---------+-------------------+------+------------+-----------+</div><div>| symfony-cli-movements | RUNNING | 10.0.1.88 (eth0) | | PERSISTENT | 1 |</div><div>+-----------------------+---------+-------------------+------+------------+-----------+</div><div>| symfony-cli-staging | RUNNING | 10.0.1.217 (eth0) | | PERSISTENT | 0 |</div><div>+-----------------------+---------+-------------------+------+------------+-----------+</div></div><div><br></div><div><div> ping devop-tools.lxd</div><div>ping: unknown host devop-tools.lxd</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 28, 2017 at 4:42 PM, Adil Baig <span dir="ltr"><<a href="mailto:simplyadilb@gmail.com" target="_blank">simplyadilb@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">How do i restart dnsmasq without restarting lxd? That would pause all my containers.</div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Wed, Jun 28, 2017 at 3:47 PM, Fajar A. Nugraha <span dir="ltr"><<a href="mailto:list@fajar.net" target="_blank">list@fajar.net</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span>On Wed, Jun 28, 2017 at 4:36 PM, Adil Baig <span dir="ltr"><<a href="mailto:simplyadilb@gmail.com" target="_blank">simplyadilb@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">In the new LXD (2.5+) is there automatic DNS resolution for containers on the host? <div><br></div></div></blockquote><div><br></div></span><div>It can. But you need to make it so.</div><span><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div></div><div>I'd like to configure a virtual host on Apache (on the host mahcine) to proxy requests to a container using its DNS rather than its IP. How can i do this?</div></div>
<br></blockquote><div><br></div></span><div>(1) See <a href="https://stgraber.org/2016/10/27/network-management-with-lxd-2-3/" target="_blank">https://stgraber.org/2016/<wbr>10/27/network-management-with-<wbr>lxd-2-3/</a> . In particular:</div><div>- creating a new network bridge (or use lxdbr0, if you want)</div><div>- dns.domain and ipv4.address (for the bridge)</div><div>- (optional, if you want "static" ip for the container): "lxc network attach" and ipv4.address for the container</div><div><br></div><div>(2) configure the container to use DHCP. Dnsmasq will assign the appropriate IP based on the ip address you assign to the container in the previous step</div><div><br></div><div>(3) make sure you have dnsmasq installed on the host. Install it if you don't have it.</div><div><br></div><div>(4) make sure /etc/dnsmasq.d/lxd on the host exclude the interface created on step (1) (e.g. except-interface=lxdbr0)</div><div><br></div><div>(5) Create a file (I call mine /etc/dnsmasq.d/lxd-resolv<wbr>e), with this line (adjust IP and domain as necessary)</div><div><div>server=/lxd/<a href="http://10.0.3.1" target="_blank">10.0.3.1</a></div></div><div><br></div><div>(6) restart dnsmasq on the host if necessary</div><div><br></div><div>You can then refer to container using dns from the host</div><div><div># lxc list test</div><div>+------+---------+------------<wbr>-------+------+------------+--<wbr>---------+</div><div>| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |</div><div>+------+---------+------------<wbr>-------+------+------------+--<wbr>---------+</div><div>| test | RUNNING | 10.0.3.117 (eth0) | | PERSISTENT | 1 |</div><div>+------+---------+------------<wbr>-------+------+------------+--<wbr>---------+</div><div><br></div><div># ping -n -c 1 test.lxd<br></div><div>PING test.lxd (10.0.3.117) 56(84) bytes of data.</div><div>64 bytes from <a href="http://10.0.3.117" target="_blank">10.0.3.117</a>: icmp_seq=1 ttl=64 time=0.082 ms</div><div><br></div><div>--- test.lxd ping statistics ---</div><div>1 packets transmitted, 1 received, 0% packet loss, time 0ms</div><div>rtt min/avg/max/mdev = 0.082/0.082/0.082/0.000 ms</div></div><span class="m_-1153920663954739124HOEnZb"><font color="#888888"><div><br></div><div><br></div><div>-- </div><div>Fajar</div></font></span></div></div></div>
<br></div></div>______________________________<wbr>_________________<br>
lxc-users mailing list<br>
<a href="mailto:lxc-users@lists.linuxcontainers.org" target="_blank">lxc-users@lists.linuxcontainer<wbr>s.org</a><br>
<a href="http://lists.linuxcontainers.org/listinfo/lxc-users" rel="noreferrer" target="_blank">http://lists.linuxcontainers.o<wbr>rg/listinfo/lxc-users</a><br></blockquote></div><br></div>
</blockquote></div><br></div>