The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Canot ping from WHM server

Discussion in 'General Discussion' started by postcd, Jul 9, 2014.

  1. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    620
    Likes Received:
    6
    Trophy Points:
    18
    Hello,

    when i do

    ping gmail.com
    ping: unknown host gmail.com
    root@host1 [~]# ping cpanel.net
    ping: unknown host cpanel.net

    when sending emails it says like: "Previous Message: ****: == *@sina.com R=lookuphost defer (-1): host lookup did not complete"

    the /etc/resolv.conf contains
    nameserver 8.8.8.8
    nameserver 8.8.4.4

    please what to do?
     
  2. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    620
    Likes Received:
    6
    Trophy Points:
    18
    SOLVED
    The google nameservers IPs (mentioned above) somehow went into iptables to be blocked, not sure how...... but after removed their IPs from iptables, ping worked and mails went out.

    so im curious how to add allow rule for my nameserver ips into iptables which will have priority over any block rules added in future.
     
  3. iserversupport

    iserversupport Well-Known Member

    Joined:
    Nov 4, 2013
    Messages:
    91
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Do you have CSF installed ?

    With that you can allow IP in a single command csf -a 8.8.8.8
     
  4. triantech

    triantech Well-Known Member

    Joined:
    Jul 1, 2014
    Messages:
    145
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Kochi, India, India
    cPanel Access Level:
    Root Administrator
    Using iptables,

    # iptables -I INPUT -s 8.8.8.8 -j ACCEPT
    # iptables -I INPUT -s 4.4.4.4 -j ACCEPT
    # service iptables save
    # service iptables restart
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Yes, I suggest using CSF to allow the IP address unless you want the responsibility of managing custom iptables firewall rules.

    Thank you.
     
Loading...

Share This Page