V
V
vaniqq2016-09-06 18:16:07
linux
vaniqq, 2016-09-06 18:16:07

How to configure network interface in lxc?

Hello!
Please tell me the dns settings for the lxc container. It seems that everything is installed, everything works, but we cannot configure dns. From under the root we connect without problems, but we can’t even ping the url, only the ip address. Everything works well, in and out traffic passes, but DNS resolution does not work, i.e. ping ya.ru issues ~ ping: unknown host ya.ru
Please tell me how to be)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
Fixid, 2016-09-06
@Fixid

Option #1
pct create 105 /var/lib/vz/template/cache/debian-8.0-standard_8.0-1_amd64.tar.gz -description LXC -rootfs 4 -hostname pvecontainer01 -memory 1024 -nameserver 2001:4860:4860: :8888 -searchdomain 8.8.8.8 -net0 name=eth0,ip6=2a01:4f8:111:1111::1:255/64,gw6=2a01:4f8:1111:1111::2,bridge=vmbr0 -storage local - password changeme
Inside LXC:
Option #2
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
Option #3
in /etc/network/interfaces
dns-nameservers 8.8.8.8

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question