DNS Problem

Discussion in 'Site & Server Administration' started by Dreads, Aug 24, 2009.

  1. #1
    I have a dns problem with my server.

    PHP Error:
    
    php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution 
    
    Code (markup):
    Then i ran this command (using hyper vm)
    host google.com
    I got this error
    
    ;; connection timed out; no servers could be reached
    
    Code (markup):
    So are some possible problems and how to fix those problems.
     
    Dreads, Aug 24, 2009 IP
  2. RHS-Chris

    RHS-Chris Well-Known Member

    Messages:
    1,007
    Likes Received:
    35
    Best Answers:
    10
    Trophy Points:
    150
    #2
    What is in the '/etc/resolv.conf' file? This is where your servers external name servers should be listed. To use OpenDNS's servers, place this following in:

    nameserver 208.67.222.222
    nameserver 208.67.220.220
     
    RHS-Chris, Aug 24, 2009 IP
  3. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #3
    Try editing /etc/resolv.conf to give your nameserver IPs instead of others
     
    Bohra, Aug 24, 2009 IP
  4. GNetCoder

    GNetCoder Peon

    Messages:
    68
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    what is the OS of your server? Definitely check /etc/resolv.conf (assuming linux). Here are some things that have caused me this error in the past:

    resolv.conf not configured
    resolv.conf set with unresponsive nameservers (try opendns)
    eth0 not up (use ifconfig to check)
    ping an IP address of a known server. Results?
    Running a firewall? Check that DNS requests are allowed out.
    Restart networking; maybe a recent change was not implemented?
    Reboot the server (and drink a beer). You would be surprised. :)
     
    GNetCoder, Aug 25, 2009 IP
  5. Dreads

    Dreads Well-Known Member

    Messages:
    1,884
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    150
    #5
    Thanks, it was the nameservers.

    How do I keep them perm.? Because if I restart my vps, they go back to the original.
     
    Dreads, Aug 26, 2009 IP
  6. GNetCoder

    GNetCoder Peon

    Messages:
    68
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #6
    If you are using Debian or Ubuntu, check /etc/network/interfaces. Your host may have set nameservers there. (there is a similar file for other Linux distros).

    After that, resolv.conf should survive a reboot unless your host set another init script somewhere that resets defaults for some reason
     
    GNetCoder, Aug 26, 2009 IP