-2

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.

Bibhas
  • 119
  • 6

1 Answers1

2

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.

Chopper3
  • 100,240
  • 9
  • 106
  • 238
  • Yes. Can you post a guide for that? – Bibhas Aug 03 '11 at 08: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; http://code.google.com/speed/public-dns/docs/using.html – Chopper3 Aug 03 '11 at 08: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 03 '11 at 08: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 03 '11 at 08:59
  • if it's set to get its DNS address via DHCP then probably yes, but you just override that manually. – Chopper3 Aug 03 '11 at 09:00