Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
38
rated 0 times [  38] [ 0]  / answers: 1 / hits: 37457  / 3 Years ago, tue, september 14, 2021, 9:00:52

I (think) that I've configured a static IP address in /etc/network/interfaces:



# The primary network interface 
auto eth0
iface eth0 inet static
address 10.1.1.2
netmask 255.255.255.0
network 10.1.1.0
broadcast 10.1.1.255
gateway 10.1.1.1


And I change the file /etc/resolv.conf to include the desired nameservers.



Then I restart networking sudo /etc/init.d/networking restart



But after some hours resolv.conf always reverts back to the DHCP nameserver.





I should also say that this is Ubuntu Server with only l0 and eth0 interfaces.


More From » networking

 Answers
1

If you want to override or append to the name servers suggested by the DHCP server, you can configure this in /etc/dhcp/dhclient.conf, eg:



interface "eth0" {
prepend domain-name-servers 10.0.0.2;
}


You can also do this from the "Edit Connections" control in the network indicator in Unity or GNOME.


[#43322] Thursday, September 16, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rvousnove

Total Points: 456
Total Questions: 130
Total Answers: 98

Location: El Salvador
Member since Sun, Sep 12, 2021
3 Years ago
;