Difference between revisions of "CentOS 7.x lxc container creation fails due to host resolution"

From Notes_Wiki
(Created page with "<yambe:breadcrumb>CentOS_7.x_lxc_troubleshooting|CentOS 7.x lxc troubleshooting</yambe:breadcrumb> =CentOS 7.x container creation fails due to host resolution= It is possible...")
 
m
Line 1: Line 1:
<yambe:breadcrumb>CentOS_7.x_lxc_troubleshooting|CentOS 7.x lxc troubleshooting</yambe:breadcrumb>
<yambe:breadcrumb>CentOS_7.x_lxc_troubleshooting|CentOS 7.x lxc troubleshooting</yambe:breadcrumb>
=CentOS 7.x container creation fails due to host resolution=
=CentOS 7.x lxc container creation fails due to host resolution=


It is possible that CentOS 7.x container creation fails with errors similar to
It is possible that CentOS 7.x container creation fails with errors similar to

Revision as of 16:00, 23 January 2017

<yambe:breadcrumb>CentOS_7.x_lxc_troubleshooting|CentOS 7.x lxc troubleshooting</yambe:breadcrumb>

CentOS 7.x lxc container creation fails due to host resolution

It is possible that CentOS 7.x container creation fails with errors similar to

[Errno 14] curl#6 - "Could not resolve host: centos.mirror.snu.edu.in; Unknown error"
Trying other mirror.

even though DNS is working fine. This is possible because lxc (unfortunately) uses DNS configuration from cache and not from host. That is lxc-create uses DNS configuration from

/var/cache/lxc/centos/x86_64/7/rootfs/etc/resolv.conf

for centos-7 containers. To solve the issue edit above file and add appropriate nameserver. If 4.2.2.2 and 8.8.8.8 are used then the settings should work at multiple locations without any problem.