Invalid domains are rewritten to invaliddomain.hostname

wilson18

Member
Mar 4, 2014
9
0
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
 

TheJudge

Member
Mar 6, 2014
8
0
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
 

wilson18

Member
Mar 4, 2014
9
0
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
 

wilson18

Member
Mar 4, 2014
9
0
1
cPanel Access Level
Root Administrator
Can you paste the entire resolv.conf file here? I'm interested in search or domain entries.
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!
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
I am happy to see that the issue is now resolved. Thank you for updating us with the outcome.