switch my DNS server To Google Dns ??

XFAISAL

New member
Joined
Sep 30, 2009
Messages
3
Hello

how i can switch the Dns to This free google dns servers ::
8.8.8.8
8.8.4.4


???
 
Type the following as the root user at your Linux terminal/console:

> /etc/resolv.conf
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
echo "nameserver 8.8.4.4" >> /etc/resolv.conf

Done!
 
That will add two additional servers to the bottom of your resolv.conf file.

To change to those servers you should edit /etc/resolv.conf and make sure these two nameserver lines are either the only nameserver lines, or at least the top two nameserver lines:
Code:
nameserver 8.8.8.8
nameserver 8.8.4.4

You may have other lines above the nameserver lines.

Note that nothing needs to be restarted.

Jeff
 
Hi Jeff

The first command will erase the entire contents of the /etc/resolv.conf file and then the other two commands will add the nameservers accordingly...

I thought that maybe that would be the easiest way to address this user's query.
 
While I didn't realize that you could leave out the echo command and that it would be implied (thanks for that bit of info), I still have a minor issue in that there may be other lines in the file which may be important on an individual server; our resolv.conf files also include the default domain and the default search, both of which may important to some administrators.

Jeff
 
I guess you have a point with that one Jeff... I don't use the default domain and default search options in the resolv.conf file, so I must've overlooked that part.

I guess the user could manually edit the /etc/resolv.conf file and make the necessary changes like that...

Debian:

apt-get install mc

CentOS:

yum install mc

Then:

mcedit /etc/resolv.conf

Once completed with the file editing, hit the F10 button to save and close the file.
 
Any reason to install MidnightCommander on a server just to edit a file, when there are so many editors already available?

Jeff
 
I happen to like MC because, as far as I know, it was originally developed by a South African programmer.

I am South African... Just showing some support, that's all.
 
Warning:
Midnight Commander (similar to the old Norton Commander for MS-DOS) allows you to do many things, makes many things easy. Including things that perhaps you should leave alone for DirectAdmin to handle.

The biggest issue I see with Midnight Commander is that it makes some things so easy that you may forget you still have to be the experienced systems administrator and make proper decisions.

That all said, I have a good friend who swears by Midnight Commander and who uses it quite successfully alongside DirectAdmin.

Jeff
 
Back
Top