Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Containers
User Name
Linux - Containers This forum is for the discussion of all topics relating to Linux containers. Docker, LXC, LXD, runC, containerd, CoreOS, Kubernetes, Mesos, rkt, and all other Linux container platforms are welcome.


  Search this Thread
Old 04-23-2019, 10:11 AM   #1
LQ Newbie
Registered: Mar 2019
Posts: 17

Rep: Reputation: Disabled
DNS resolution in LXC container

Hi all,
I'm using srsLTE-emane (, an open source software that emulates LTE Network, and I have a problem with DNS resolution in LXC container.

I'm running a demonstration (found on made by three containers: ue-02 (the mobile phone), enb-21 (the radio base station) and epc-01 (the core network of LTE). I'm able to ping any IP address from ue-02 (for example

root@ue-02:~# ping -c 5
PING ( 56(84) bytes of data.
64 bytes from icmp_seq=1 ttl=50 time=96.8 ms
64 bytes from icmp_seq=2 ttl=50 time=95.1 ms
64 bytes from icmp_seq=3 ttl=50 time=94.5 ms
64 bytes from icmp_seq=4 ttl=50 time=93.0 ms
64 bytes from icmp_seq=5 ttl=50 time=91.8 ms
I'm not able to activate the DNS resolution (where is the internet site related to

root@ue-02:~# nslookup
;; connection timed out; no servers could be reached
root@ue-02:~# LC_ALL=C ping
ping: Name or service not known
I have read the instructions to modify the file resolv.conf, but these containers don't have this file: these are a bit different from classical LXC containers. The unique configuration file is lxc.conf.

Code: = empty

lxc.console.path = none
lxc.tty.max = 1
lxc.pty.max = 128
lxc.cgroup.devices.allow = a = proc sys cgroup

lxc.autodev = 1
lxc.hook.autodev = /usr/share/emane-model-lte/demo/two_ues/ue-02/
lxc.apparmor.profile = unconfined
the only differences with lxc.conf of the other two containers are in the name and in the IP addresses.

Someone could help me?

Thank you very much!!

Old 04-24-2019, 10:16 AM   #2
Registered: Jan 2014
Location: Acworth, Georgia, USA
Distribution: Arch Hardened, Ubuntu 18.04, Fedora 30
Posts: 149

Rep: Reputation: Disabled
Do you have LXC configuration files in /etc/dnsmasq.d-available ??

I think modifying them with the line "dhcp-option=<your name server>" should work.
Old 04-25-2019, 03:36 PM   #3
LQ Newbie
Registered: Mar 2019
Posts: 17

Original Poster
Rep: Reputation: Disabled
Hi Rick! Thank you for your answer!!
Yes, I have found the file. What should I use in "your name server"? I have tried
but these don't work...


Last edited by andre88; 04-25-2019 at 04:05 PM. Reason: Update of the attempts
Old 05-07-2019, 03:15 AM   #4
LQ Newbie
Registered: Mar 2019
Posts: 17

Original Poster
Rep: Reputation: Disabled
I have solved the problem, typing

echo "nameserver" | sudo tee -a /etc/resolv.conf


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] "lxc list" vs "lxc-ls" yknivag Linux - Virtualization and Cloud 1 03-09-2017 05:53 AM
LXC Container: sound Not working charlie101 Linux - Virtualization and Cloud 10 06-14-2015 11:16 AM
[SOLVED] Outputting X display from inside an LXC Container charlie101 Linux - Virtualization and Cloud 1 02-04-2013 09:41 PM
script to get a lxc-container like iso of current. cod_liver_0il Slackware 1 09-10-2012 11:12 AM
How to end a Linux Container (LXC) from within? Skaperen Linux - Virtualization and Cloud 0 06-14-2011 09:37 AM > Forums > Linux Forums > Linux - Containers

All times are GMT -5. The time now is 06:07 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration