Is there any way to add nameserver without modification of configuration files?

1

I need to add my own nameserver, but if I boot installation CD/DVD, I can't edit configuration files. So I'm searching for any way to add the nameserver from terminal.

kravemir

Posted 2011-11-05T07:35:18.200

Reputation: 2 447

Answers

2

You can add a name server by editing /etc/resolv.conf as root.

sudo vi /etc/resolv.conf

Add the line

nameserver 10.10.10.10

Change 10.10.10.10 to the IP address of your nameserver.

Paul

Posted 2011-11-05T07:35:18.200

Reputation: 52 173

But isn't there any command to change it without editing the resolv.conf? – kravemir – 2011-11-05T12:58:49.700

Your distribution might have a helper script that updates nameservers but all it would do is edit resolv.conf. Is there a reason why you can't edit it directly? – Paul – 2011-11-05T13:37:22.887