Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm taking a course on server administration at school and I have managed to set up virtual hosting in apache and a dns server on a virtual machine. However, I have now set up an old pc to run CentOS and I'm trying the same on that box.

The problem I ran into now is that I can't resolve hostnames from the linux box. I have set up the nameserver in /etc/resolv.conf to the IP of the CentOS machine, but when I try for example

ping google.com I get ping: unknown host google.com

However, when I do ping 66.102.13.105 (which is the Google IP, figured that out by pinging on my mac) I get:

PING 66.102.13.105 (66.102.13.105) 56(84) bytes of data.
64 bytes from 66.102.13.105: icmp_seq=1 ttl=52 time=15.5 ms

Slightly confused why this is happening. Could it be because of my router sitting in between the linux machine and the cable modem? It's a D-Link somethingsomething.

Thanks in advance

share|improve this question
    
You need to make sure you can reach the DNS server. Also, the DNS server should be configured properly and should be able to query other DNS servers and/or access public DNS servers. You need to provide us with more details about your setup. –  Khaled Nov 12 '11 at 12:55
    
Can you paste your named.conf file? It sounds like you are trying to setup a caching server. –  Rilindo Nov 12 '11 at 17:16
    
So how does your DNS-server know how to ask about the .com Domain? –  Nils Nov 12 '11 at 21:35

1 Answer 1

Well, probably the server that you set in resolv.conf is not accessible or it does not provide you an answer for google.com

dig @IP-of-your-dns-server google.com

and

ping IP-of-your-dns-server

Unlikely your router have anything to do with it.

share|improve this answer
    
The DNS server is running on the box itself. This is only for testing purposes, because I want to then set my mac's dns server to the test box and be able to use the domainnames I set up there (to fake them). Makes sense? Ping <ip> works, but the dig command doesn't work. –  cabaret Nov 12 '11 at 16:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.