Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top


I want to use Google DNS for my localhost server. Is that possible? The main reason for this is I keep getting the following errors for the functions like file(), fopen() etc.

Warning: file(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /var/www/html/crawler/classes/internal/crawler.php on line 22

It's related to DNS I think. So thought it might be possible to use the Google DNS to resolve this.

share|improve this question
show us some of the errors, might be easy to fix – Sgaduuw Aug 3 '11 at 8:03
I think "consult your sysadmin" is the only sensible answer here. – womble Aug 3 '11 at 8:21
@womble This is my personal machine. So no Sysadmin here. I'm trying to solve and learn. – Bibhas Aug 3 '11 at 8:43
Then this question is off-topic for Server Fault, as per the FAQ. – womble Aug 3 '11 at 8:49
Got it. Thanks. – Bibhas Aug 3 '11 at 8:59

Can't say I 100% understand your question but if what you're asking is can you set google's DNS servers to be used as your internal server's DNS resolvers then yes - obviously you'll need a valid route to them but yes you can - in fact the machine I'm typing on now does just that.

share|improve this answer
Yes. Can you post a guide for that? – Bibhas Aug 3 '11 at 8:42 just set your DNS servers to be and - it's that easy. Here's google's own 'how-to' on this but it's super easy; – Chopper3 Aug 3 '11 at 8:47
I guess I'm being stupid here. Soo, the DNS my internet connection is using is the DNS my localhost is using. Is that Right? – Bibhas Aug 3 '11 at 8:50
Yes and no. Your localhost probably uses the Router's DNS which uses the ISP's DNS, which uses ... . Or you break the chain by configuring another DNS server on either machine. – mailq Aug 3 '11 at 8:59
if it's set to get its DNS address via DHCP then probably yes, but you just override that manually. – Chopper3 Aug 3 '11 at 9:00

Your Answer


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.