Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

the hostname resolve a different IP

Status
Not open for further replies.

hornet1970

IS-IT--Management
Sep 20, 2011
3
0
0
IT
hello all
I manage a server and Apache web server on cPanel and WHM through
performing a ping on the 'host name, the result is a different IP from what it should be and it is unreachable.
I tried changing the 'IP address, by reassigning WHM' s IP address using the function: 'Add an A entry for your hostname'
it says it can not do that because an another value is present, the wrong IP.
how can I fix this?
thank you in advance
 
Look at the file /etc/hosts if it is present and you have access to it. The values in this file generally take precedence over DNS lookups if I remember correctly.

Generally the format of the file is:

IP Address [Tab] List of hostnames/aliases seperated by spaces

example:

10.1.63.179 hostname hostnamealias1 hostnamealias2
127.0.0.1 localhost

etc.....

Your list of hostnames/aliases that are separated by spaces should have the most important one first on the list, and that is typically the main hostname of your server.
 
thank you..
in the file I see:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 ottica localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
95.141.45.26 piemur.photooptical.com piemur piemur.photooptical.tld ottica.photooptical.tld ottica

and the IP is correct...
 
If the IP is correct make sure the addresses are listed with the one that matters the most coming first. What do you want the hostname to come back as?

This could be a DNS configuration issue too possibly.

If you type 'dig hostname' (no quotes) from the $ prompt (or # prompt) what does it come back with?

You could, for example, type 'dig piemur.photooptical.com' and it should tell you what nameserver it got its answers from. Then you can look at that nameserver's zone configurations and see if there are any typos.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top