Skip to content

Instantly share code, notes, and snippets.

@apps-online
Created August 23, 2023 17:06
Show Gist options
  • Save apps-online/62f9adbed6360129ae3781a8b972e905 to your computer and use it in GitHub Desktop.
Save apps-online/62f9adbed6360129ae3781a8b972e905 to your computer and use it in GitHub Desktop.
DNS config.

DNS config

1 - Check the nsswitch.conf file

grep hosts /etc/nsswitch.conf

  • files = /etc/hosts

  • dns = /etc/resolv.conf

2 - Edit hosts file

nano /etc/hosts

3 - Edit hostname file

nano /etc/hostname

4 - Edit resolv.conf file

nano /etc/resolv.conf

5 - Leave the file unchanged or chattr -i /etc/resolv.conf to undo the immutation

chattr +i /etc/resolv.conf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment