LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Resolve hostnames to IP (http://www.linuxquestions.org/questions/linux-networking-3/resolve-hostnames-to-ip-546132/)

veeruk101 04-14-2007 11:57 PM

Resolve hostnames to IP
 
I'm able to ping external addresses, but cannot yet ping their hostnames successfully. So far I haven't configured anything related to the DNS server to use, and am wondering how to go about doing so.

Edit: It might be useful to point out that this question relates to specifying a DNS server to use in my own name resolution, such as for browsing the web, rather than creating/hosting my own DNS server for others to use.

Some tutorials have led me to believe I have to do all sorts of stuff with DNS/BIND configuration files, which seems like something a bit different than what I'm trying to do. I'm basically just trying to specify somewhere my DNS server. Does this have something to do with the ifcfg-eth0 file?

In the GUI version of RHEL I remembered being able to specify primary, secondary, and tertiary DNS servers. What's the command-line equivalent of that functionality from a RHEL (well, CentOS) without GUI?

Where would I get the address of my DNS server? Could I just put in the name of any DNS server out there on the Internet, or does it have to be provided by my ISP in particular? Pardon my ignorance, I'm just getting started.

Thanks.

macemoneta 04-15-2007 12:08 AM

For command line configuration, you can use:

system-config-network-tui

Or just edit /etc/resolv.conf:

nameserver 208.67.222.222
nameserver 208.67.220.220

The values above are for the OpenDNS DNS servers, which are free to use. You can get your ISP's DNS servers from their web site, usually in the support section.

bouchecl 04-15-2007 12:40 AM

Quote:

Originally Posted by veeruk101

Where would I get the address of my DNS server? Could I just put in the name of any DNS server out there on the Internet, or does it have to be provided by my ISP in particular? Pardon my ignorance, I'm just getting started.

Thanks.

Like the previous poster said, check the support section of your ISP web site. You migth want to ping these addresses to see it they're fast.

I personnally like to add 3 nameservers to my /etc/resolv.conf

First: my local DNS server (if you have one)
Second: one of my ISP's DNS (pick the fastest one)
Third: a DNS from a local university (the admins there are usually very good)


All times are GMT -5. The time now is 10:37 PM.