To configure the DNS name server IP address on an Ubuntu Linux system (as a DNS client), you can follow these steps:
/etc/resolv.conf
file in a text editor:sudo nano /etc/resolv.confSourc:ewww.lautturi.com
nameserver 8.8.8.8 nameserver 8.8.4.4
/etc/resolv.conf
file and close the text editor.The DNS name server IP address should now be configured on the system. You can verify the configuration by running the cat /etc/resolv.conf
command, which should display the name servers that you configured.
Keep in mind that the /etc/resolv.conf
file is overwritten by the Network Manager service when the network configuration is changed. If you want to make the DNS name server configuration persistent, you will need to configure it in the Network Manager settings instead.
To do this, you can use the nmcli
command to set the DNS name servers for a specific network connection. For example, to set the Google Public DNS servers for the eth0
interface, you can use the following command:
sudo nmcli connection modify eth0 ipv4.dns "8.8.8.8 8.8.4.4"
This will set the DNS name servers for the eth0
interface to 8.8.8.8
and 8.8.4.4
. The changes will be applied when the network connection is brought up.
Alternatively, you can use the NetworkManager.conf
configuration file to set the DNS name servers for all network connections.