Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Centos 6.4 "ping : unknown host google.com"
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Centos 6.4 "ping : unknown host google.com"

Help me, i am newbie in server. I have server with centos 6.4 , lo and eth0 is already up. but it cannot ping to google . setting /etc/resolv.conf nameserver 127.0.0.1 .

please help me. thx before

«1

Comments

  • fix your dns server

  • Change 127.0.0.1 to 8.8.8.8 (public dns by Google)

  • edited August 2013

    Add the following to resolv.conf

    nameserver 8.8.8.8
    nameserver 8.8.4.4

  • kucingbelang4kucingbelang4 Member
    edited August 2013

    @ShardHost said:
    Add the following to resolv.conf

    nameserver 8.8.8.8
    nameserver 8.8.4.4

    now my /etc/resolv.conf nameserver 8.8.8.8 nameserver 8.8.4.4 , still cannot ping google.com it said "ping: unknown host google.com"

  • i tried to pinging itself and return "Destination Host Prohibited". what is that??

  • Is it connected to internet ? Pleease test ping to 8.8.4.4 and 8.8.8.8, what is the result?

  • Try restarting your server.

  • Are u Indonesian ?

  • @knopix80 said:
    Is it connected to internet ? Pleease test ping to 8.8.4.4 and 8.8.8.8, what is the result?

    yes , when i tried to ping 8.8.4.4 and 8.8.8.8 the result was return nothing (i forced to stop ctrl + z)

  • knopix80knopix80 Member
    edited August 2013

    It seems you should fix the gateway until your box connected to internet.

  • c0yc0y Member

    @kucingbelang4 said:
    i forced to stop ctrl + z

    ^Z doesn't stop it, it moves it to the background (resume using the 'fg' command)

    Use ^C instead (^ = control of course)

  • kucingbelang4kucingbelang4 Member
    edited August 2013

    @knopix80 said:

    It seems you should fix the gateway until your box connected to internet.

    gateway?? am using 192.168.19.1 , and the webserver 192.168.19.20 . can i assign etc/resolv.conf with 192.168.19.1 ??

  • @knopix80 said:
    Are u Indonesian ?

    yess , sory for my bad english :p

  • @kucingbelang4 said:
    gateway?? am using 192.168.19.1 , and the webserver 192.168.19.20 . can i assign etc/resolv.conf with 192.168.19.1 ??
    @kucingbelang4 said:
    gateway?? am using 192.168.19.1 , and the webserver 192.168.19.20 . can i assign etc/resolv.conf with 192.168.19.1 ??

    Please do tracert 8.8.4.4

  • kucingbelang4kucingbelang4 Member
    edited August 2013

    @Casius said:
    Try restarting your server.

    am done with restart the server, and still return "
    ping: unknown host google.com" :/

  • @knopix80 said:
    Please do tracert 8.8.4.4

    am traceroute 8.8.4.4 and return "

    traceroute to 8.8.4.4 (8.8.4.4), 30 hops max, 60 byte packets
    1 192.168.19.1 (192.168.19.1) 0.291 ms 0.461 ms 0.299 ms
    1 192.168.19.1 (192.168.19.1) 0.291 ms 0.461 ms 0.299 ms
    1 192.168.19.1 (192.168.19.1) 0.291 ms 0.461 ms 0.299 ms
    2 * * *
    3 * * *
    4 * * *
    5 * * *
    6 * * *
    ",

    what is that mean??

  • @Frost said:
    Use ^C instead (^ = control of course)

    i stop it forced because get more than 3 minutes to respond. its timeout right?

  • c0yc0y Member

    @kucingbelang4 said:
    i stop it forced because get more than 3 minutes to respond. its timeout right?

    Ping on linux will keep pinging (or at least attempting) until you kill it or when you specify an amount of pings it should emit (-c flag)

    To see if it's still running, try:

    ps aux | grep ping | grep -v grep

    To get rid of them the easy way is:

    killall ping

    Although one could argue this is a cleaner method in general:

    for x in $(ps aux | grep ping | grep -v grep | awk '{print $2}'); do kill $x; done
  • If it's a default install, eth0 isn't setup by default. Even by running ifconfig eth0 up, you'll still have issues. The CentOS FAQ has more info.

    Thanked by 1seriesn
  • @Adduc said:
    If it's a default install, eth0 isn't setup by default. Even by running ifconfig eth0 up, you'll still have issues. The CentOS FAQ has more info.

    am using minimal install centos 6.4 final

  • @Frost said:

    for x in $(ps aux | grep ping | grep -v grep | awk '{print $2}'); do kill $x; done

    when i use killall ping, it return "ping: no process killed"

  • Is NetworkManager running ? Disabling it might help.

    service NetworkManager stop
    chkconfig NetworkManager off
    reboot
    
  • @Frost - pls don't hijack this thread with your fancy commands.

  • To be sure wether you have internet at all, does your internet work correctly?

    route -n

  • @DennisdeWit said:
    To be sure wether you have internet at all, does your internet work correctly?

    route -n

    when i try route -n , it return "

    Kernel IP routing table
    Destination Gateway Genmask Flags Metric Ref Use Iface
    192.168.19.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
    169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eth0
    0.0.0.0 192.168.19.1 0.0.0.0 UG 0 0 0 eth0

    ".
    whats that mean?

  • kucingbelang4kucingbelang4 Member
    edited August 2013

    @prred said:
    Is NetworkManager running ? Disabling it might help.

    service NetworkManager stop
    chkconfig NetworkManager off
    reboot
    

    why should i disabling it off?

  • AlexBarakovAlexBarakov Patron Provider, Veteran

    What kind of VPS is this? KVM/OpenVZ?

    Are gateways setup properly? Are you using DHCP or manually configuring the network? If you try pinging an ip directly (8.8.8.8) do you get a response?

    To me it sounds like a gateway issue.

  • is this a virtualbox or vmware?

    try to change the network adapter :)

  • MelitaMelita Member, Host Rep
    edited August 2013

    Seems like just a local office computer?

    IP address 192.168.19.20, gateway 192.168.19.1. Please check if there are other windows computer with same network / gateway which can connect to internet. Your LAN router might not passing any traffic at all.

    My other suspicion is this (since you tell about prohibited packet): Would you mind to tell the output of

    iptables -L -n -v

    You can also always try to do

    service iptables stop

    then

    ping 8.8.8.8

    does it works?

    If it's working, just edit /etc/resolv.conf to

    nameserver 8.8.8.8

    nameserver 8.8.4.4

    And it should be able to resolve hostname now.

  • Let's start with basics. Run

    ifconfig -a
    

    to show the state of network interfaces. Is eth0/whatever it's called up?

    iptables -L
    

    will show firewall status.

    cat /etc/resolv.conf
    

    shows current resolver state (what NS records are available). Note that under normal circumstances you don't have to correct /etc/resolv.conf manually.

    Unless network interface is up and tuned correctly, no external connectivity would occur.

    Advice: when posting file contents/program outputs, add four spaces in front of every line, in order the output was just as programs output them, not concatenated to a single line.

Sign In or Register to comment.