Change the order to DNS first and then hosts

  1. I type the below command and its say permission denied.
    bob@caleston-lp10:~$ /etc/nsswitch.conf
    -su: /etc/nsswitch.conf: Permission denied

  2. Then I type the command bob@caleston-lp10:~$ cat /etc/nsswitch.conf
    it give the below result

/etc/nsswitch.conf

Example configuration of GNU Name Service Switch functionality.

If you have the glibc-doc-reference' and info’ packages installed, try:

`info libc “Name Service Switch”’ for information about this file.

passwd: compat systemd
group: compat systemd
shadow: compat
gshadow: files

hosts: files dns
networks: files

protocols: db files
services: db files
ethers: db files
rpc: db files

netgroup: nis

When I click on the check it give me a message

The DNS Server is not defined first in the nsswitch.conf file

Please guide me…!!!

Firstly /etc/nsswitch.conf is a system file. It is owned by root, therefore you must use sudo on commands to modify the file.

sudo vi /etc/nsswitch.conf

The line in this file concerned with this question is this one

hosts: files dns