0

I have tried add den-nameservers 114.114.114.114 and modify "/etc/NetworkManager/NetworkManager.cong" #dns=dnsmasq but after reboot , the "/etc/resolv.conf" still

  • nameserver 192.168.2.1 nameserver 192.168.2.1 And i can't find the directory of "/etc/resolvconf/resolv.conf.d/" in my system, so im not sure modify "/etc/resolvconf/resolv.conf.d/base" is useful And I remove network-maneger, then modify "/etc/resolv.conf"

  • nameserver 144.114.114.114

but when I reboot, "/etc/resolv.conf" still

  • nameserver 192.168.2.1 nameserver 192.168.2.1

    This confused me, what is generated /etc/resolv.conf when reboot and how can i set a DNS without using network-manager??

0

Here is my /etc/network/interfaces

  # interfaces(5) file used by ifup(8) and ifdown(8)
  # Include files from /etc/network/interfaces.d:
  # source-directory /etc/network/interfaces.d

  source /etc/network/interfaces.d/*

  #The loopback network interface 
  auto lo
  iface lo inet loopback 

  #The primary network interface 
  auto  eth0
  iface eth0 inet static 
   address 192.168.18.226
   netmask 255.255.255.0
   network 192.168.18.0
   broadcast 192.168.18.255
   gateway 192.168.18.1
   dns-nameservers 211.138.151.161 211.138.55.66
0

If you remove Network Manager, then, in 16.04, the usual way to configure networking is in the file /etc/network/interfaces. You file will look approximately like:

auto lo
inet lo iface loopback

auto enp3s0
inet enp3s0 inet static
address 192.168.1.150
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 144.114.114.114

Of course, substitute your exact details here.

If you prefer DHCP, then:

auto lo
inet lo iface loopback

auto enp3s0
inet enp3s0 inet dhcp
dns-nameservers 144.114.114.114

Reboot.

EDIT: It appears that you may have an issue with resolvconf. Please run:

sudo dpkg-reconfigure resolvconf

Use the TAB key to accept the offer to reconfigure. Reboot.

Any improvement?

  • No matter i remove the network-manager or not, the "/etc/resolv.conf" still change to 192.168.2.1 and here is my /etc/network/interfaces – Jone May 8 '18 at 6:41
  • # interfaces(5) file used by ifup(8) and ifdown(8) # Include files from /etc/network/interfaces.d: # source-directory /etc/network/interfaces.d source /etc/network/interfaces.d/* #The loopback network interface auto lo iface lo inet loopback #The primary network interface auto eth0 iface eth0 inet static address 192.168.18.226 netmask 255.255.255.0 network 192.168.18.0 broadcast 192.168.18.255 gateway 192.168.18.1 dns-nameservers 211.138.151.161 211.138.55.66 – Jone May 8 '18 at 6:41
  • I neither recommended, nor do you need, the broadcast and network entries. Please see my edit above in a few moments. – chili555 May 8 '18 at 12:44
  • If my answer was helpful, please accept it: askubuntu.com/tour – chili555 May 9 '18 at 2:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.