Incorrect DNS settings, php_network_getaddresses: getaddrinfo failed Name or service unknown, nslookup

The problem initially looked like this:

Warning: file_get_contents () [function.file-get-contents]: php_network_getaddresses: getaddrinfo failed: name or service unknown in / home / / /ppk_hotweb.class.php on line 58

I also used cURL, it just returned null that it is .. Both (file and cURL) were included.

Tried file_get_contents('google.com') and it worked!

Why does file_get_contents('domain.com.au') not work?

So, I started reading the relevant stackoverflow messages, and people say that this is a problem with the DNS settings.

I tried the following:

 > # ping domain.com.au ping: unknown host domain.com.au 

What happened to the host? The site is live.

also:

# nslookup



Server: 203.16.60.
Address: 203.16.60. # 53

*** Cannot find domain.com.au: no response

and

 > # dig domain.com.au ; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.10.rc1.el6_3.2 <<>> domain.com.au ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 52814 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0 ;; QUESTION SECTION: ;domain.com.au. IN A ;; AUTHORITY SECTION: domain.com.au. 3600 IN SOA ns1.web24.net.au. dns.web24.net.au. 2012080201 7200 3600 604800 3600 ;; Query time: 1 msec ;; SERVER: 203.16.60.***#53(203.16.60.3) ;; WHEN: Sat Aug 4 05:43:23 2012 ;; MSG SIZE rcvd: 92 

I will really appreciate any help! Thanks.

UPD: btw, just tried searching for whois ...

domain.com.au not available

: (

+4
source share
2 answers

The DNS server used by your server may use the old cached DNS records, since finding this host works for me.

My dig results also return a valid A record, which is not displayed to you.

This probably won't change anything given the DNS problems, but

 file_get_contents('domain.com.au'); 

it should be:

 file_get_contents('http://domain.com.au'); 

Using the first parameter will try to find the local file, and not use the http wrapper.

If you have permission, try changing the name servers in the /etc/resolv.conf file to other name servers.

+5
source

you can use this command without https as shown below.

  php -r "readfile('http://symfony.com/installer');" > symfony 
-1
source

All Articles