View Full Version : Manually Specifying DNS Server in Linux
Aaron
09-02-2004, 09:16 PM
How can I manually specify the DNS server I want my adapter to use? I've tried editing /etc/resolv.conf and with the interface up and down and various combos, but it always gets set back to the subnet's DNS, and I want it to use mine, running on another machine. Maybe its something obvious, but what can I do? (from the command line preferably).
Thanks
Dj Yoshi
09-02-2004, 10:17 PM
nameserver ip
I do believe.
------------------
There is no signature
Aaron
09-02-2004, 11:23 PM
I already tried that, it doesn't exist on that box. Its a more or less default debian sarge install if that helps.
Dj Yoshi
09-02-2004, 11:49 PM
No reason it shouldn't work--it worked on my knoppix install. Wait for Matty or someone to see this.
------------------
There is no signature
Do you use DHCP?
If so, I think it sets the DNS-Server automatically.
You can change that (at least in Gentoo) in /etc/conf.d/net
------------------
Sorry for the lousy English
Cool Matty
09-03-2004, 04:46 AM
Yeah, what Impi said. DHCP by default attempts to obtain the DNS server by itself. You need to specify in the net file what DNS server you need to use.
------------------
"The future is not determined by a throw of the dice, but is determined by the conscious decisions of you and me."
I am addicted to ellipses!!! AHHH!!! ...
Make Sorrowind Worthwhile... join it! http://sorrowind.net
If your using DHCP, just restart your networking handle (`/etc/init.d/networking restart`) or run the DHCP client (`dhclient`).
Otherwise...
1) Set your IP: (`ifconfig eth0 IP_ADDRESS'), where 'eth0' is your actual interface (it problably is eth0) and IP_ADDRESS is the IP address you want.
2) Set your gateway: (`route add default gw IP_ADDRESS`), where IP_ADDRESS is the address of your gateway(router).
3) Set your name server: edit /etc/resolv.conf: it should contain one line with the following syntax: "nameserver IP_ADDRESS", where IP_ADDRESS is the IP of the name server you want to use.
Now, isnt DHCP soooo much easier? http://forums.massassi.net/html/tongue.gif
------------------
Gonads are useful for their purpose, but they are no substitute for brains.
: (http://shauri.hopto.org/quotes.pl)w (http://shauri.hopto.org)q (http://www.massassi.net/levels/files/2533.shtml)! (http://shauri.hopto.org/polls.pl)
Aaron
09-03-2004, 06:47 AM
:P
The goal is to be smarter than the DHCP! I want everything the DHCP gives me except for the name servers. Anyway, I'll try editing it again, and get back to you with specifics.
vBulletin® v3.7.3, Copyright ©2000-2009, Jelsoft Enterprises Ltd.