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.

Invalid domains are rewritten to invaliddomain.hostname

Discussion in 'General Discussion' started by wilson18, Mar 6, 2014.

  1. wilson18

    wilson18 Member

    Joined:
    Mar 4, 2014
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi,

    We have just set up our first server and a customer of ours has mentioned that they use the get_headers function in php to see if a domain is real. One of the examples he was going was fsdh. What he found was that our server was automatically changing this to fsdh.hostname and looking for that which was always returning a 200 response.

    I have then done this through ssh and tried to ping fsdh and it then pings fsdh.hostname. Is this expected and is there anyway to get around this?

    Thank you
     
  2. TheJudge

    TheJudge Member

    Joined:
    Mar 6, 2014
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi,

    Check /etc/resolv.conf file. Most probably you have set there domain or search as "hostname". This string is then concatenated to whatever you ping in case that the "string" that you're pinging is not resolvable directly(via DNS or via hosts file). This is a normal behaviour.


    Regards,
    Raul
     
  3. wilson18

    wilson18 Member

    Joined:
    Mar 4, 2014
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi Raul,

    The contents of the resolv file are 8.8.8.8 and 8.8.4.4
    the hosts file is

    127.0.0.1 localhost.localdomain localhost localhost4.localdomain4 localhost4
    # Auto-generated hostname. Please do not remove this comment.
    ip hostname localhost6.localdomain6 host localhost6 localhost.localdomain
    ::1 localhost


    I cant see anything wrong, am I missing anything?

    Any suggestions~

    Thanks
     
  4. TheJudge

    TheJudge Member

    Joined:
    Mar 6, 2014
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Can you paste the entire resolv.conf file here? I'm interested in search or domain entries.
     
  5. wilson18

    wilson18 Member

    Joined:
    Mar 4, 2014
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    All its say in /etc/resolv.conf is the following:
    nameserver 8.8.8.8
    nameserver 8.8.4.4

    - - - Updated - - -

    With you mentioning about the domain entries, I have just added domain hostname to it and the problem has been resolved. Thank you for mentioning it!
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,774
    Likes Received:
    663
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page