Updated:

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.

link|improve this question
show us some of the errors, might be easy to fix – Sgaduuw Aug 3 '11 at 8:03
3  
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
1  
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
feedback

1 Answer

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.

link|improve this answer
Yes. Can you post a guide for that? – Bibhas Aug 3 '11 at 8:42
erm...you just set your DNS servers to be 8.8.8.8 and 8.8.4.4 - it's that easy. Here's google's own 'how-to' on this but it's super easy; code.google.com/speed/public-dns/docs/using.html – 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
feedback

Your Answer

 
or
required, but never shown

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