14

I've created a network namespace in Linux.

I thought there was a resolv.conf file for each namespaces created but it's not the case on my system. I don't have the following path /etc/netns/namespace_name/resolv.conf.. The folder netns doesn't exist.

There is only one resolv.conf (/etc/resolv.conf and another one mirrored in /run/resolv.conf). Any changes in this file affect all network interfaces. Is there a way I can use different DNS for both the host and the namespace?

jayce153
  • 143

1 Answers1

22

You must create directory /etc/netns/_namespace_name_ yourself , and place different version resolv.conf there.

Nik
  • 469
  • 3
  • 4