1

I've added a few hostnames in /etc/hosts to resolve to my LXD container:

$ less /etc/hosts
127.0.0.1       localhost
127.0.1.1       HOST
lemh            10.0.3.219
pma.lemh        10.0.3.219
wp.lemh         10.0.3.219

But ping, getent ahosts or Firefox cannot resolve them. I don't want to restart right now.

I've tried systemctl restart networking.service to no avail. Is there a way to resolve them without restarting my system?

1 Answer 1

4

in /etc/hosts you have to write:

ip alias

so the correct form is:

127.0.0.1       localhost
127.0.1.1       HOST
10.0.3.219 lemh pma.lemh wp.lemh
1
  • You're right, and nothing needs to be restarted either. Cheers! Commented Nov 4, 2015 at 11:51

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.