From the course: Linux System Engineer: Networking and SSH

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Change DNS server

Change DNS server

From the course: Linux System Engineer: Networking and SSH

Start my 1-month free trial

Change DNS server

- [Instructor] There is no live configuration for DNS servers. Our only choice is to change configuration files. The global DNS servers are stored in /etc/resolv.conf. Interface specific DNS servers are stored in the interface specific network configuration files in /etc/sysconfig/network-scripts. We'll discuss interface specific DNS settings in the next chapter, when we discuss manual network configurations. To add or change a global DNS server, just edit the /etc/resolv.conf file and add a line specifying the DNS server. For instance, to add Google's free DNS server we could type sudo, space, vi, space, slash, etc, slash, resolv.conf. and hit enter. We're going to answer mode by pressing i and then we'll go down to the last line, and we'll add nameserver, space, 8.8.8.8 and then well save it, by doing escape colon x, and hitting enter. And that's it. Linux queries name servers in order, so if you want the new DNS server queried first, just put it at the top. There's also no need to…

Contents