Help - Search - Members - Calendar
Full Version: cPanel Changing /etc/hosts
The Planet Forums > Control Panels > cPanel/WHM
longtex
The /etc/hosts file has what appears to be a problem host listing in it. When I correct it, it gets changed back. Here's what happens.

The server's name is pecos.myhost.com and its IP address is 65.66.67.186
The /etc/hosts file looks like this:

#65.66.67.186 pecos pecos pecos.myhost.com pecos.myhost.com
# Do not remove the following line, or various programs
# that require network functionality will fail.
10.0.0.2 pecos_priv.myhost.com pecos_priv
65.66.67.186 pecos pecos pecos.myhost.com pecos.myhost.com
65.66.67.189 pecos189.myhost.com pecos189
65.66.67.188 pecos188.myhost.com pecos188
65.66.67.190 pecos190.myhost.com pecos190
65.66.67.187 pecos187.myhost.com pecos187
127.0.0.1 localhost

That first line moves up and down from day to day - sometimes it's thie first line, like here, sometimes it's the second or the third line, but the comments all stay at the top. A consultant told me to put that line as the first non-commented line (where the 10.0.0.2 is, above). I did that, but it commented it out again. I put it back, and removed the other ".186" line that's the duplicate, and it did the same thing.

I don't know that it matters, but I keep getting a message from cpanel:

IMPORTANT: Do not ignore this email.
The hostname (pecos) resolves to . It should resolve to 65.66.67.186.
Please be sure to correct /etc/hosts as well as the 'A' entry in zone file for
the domain.

Some are all of these problems can be caused by
/etc/resolv.conf being setup incorrectly. Please check this file if you
believe everything else is correct.

You see the /etc/hosts above. /resolv.conf just has two ThePlanet dns servers' IPs in it. As far as I can tell, the "A" entry for pecos (as shown in whm) is correct.

Any ideas?
soundguy
I'm getting the same error message about the server resolving to ".". What's this all about? Most of my domains seem to work as expected. One of them seems to be doing a 'round robin' with an empty directory for no apparent reason but the rest come up the way they ought to.
longtex
QUOTE (soundguy)
I'm getting the same error message about the server resolving to ".". What's this all about? Most of my domains seem to work as expected. One of them seems to be doing a 'round robin' with an empty directory for no apparent reason but the rest come up the way they ought to.


The only thing I see that doesn't work is client-based email sending - that is, sending email from outlook, eudora, kmail, et cetera... as opposed to sending from webmail. Actually the top-level names work. That is, if mistermoto is the owner (as set up in whm) of japan.com, then he has no problem sending mail through outlook as mistermoto@japan.com; but if he sets up hirohito in his cpanel, then hirohito can use webmail okay, and hirohito can read email in his outlook okay, but he can't send email... well, not always - sometimes it works and sometimes not. I don't know if it has anything to do with this problem or not... and I don't know if it's the only problem, but it's the only one I see right now.
JoeB
I've been having the same problem. Checked my resolv.conf and named.conf both look to be setup correctly. When looking at the DNS zones there is an A record for snoopy.myhost.com. But why does it not resolve?

All my sites work fine using the domain as well as the domain for my hostname. But my hostname does not resolve to an IP.

I get the same message as you are getting about there being no A record and I have spent all afternoon trying to figure out whats wrong.

I even checked over at forums.ev1servers.net and people with the same situation have either been unable to correct this or have just changed their hostname which worked for them.

Problem is i cannot change my hostname because i have other servers/apps that are setup for this hostname including my SSL cert.

Does anyone have any clue what may be the problem??????? icon_sad.gif
nature
QUOTE (longtex)
You see the /etc/hosts above. /resolv.conf just has two ThePlanet dns servers' IPs in it. As far as I can tell, the "A" entry for pecos (as shown in whm) is correct.

Are you using ThePlanet's DNS for the domains on your server?

If the answer is "Yes", then your resolv.conf is correct. But you will need to get SM to add your A entry by going to the Orbit and requesting for that through the Domain Administration link.

However, if you are running your own DNS on that server, then you should have your DNS IPs in resolv.conf, in addition to making sure the "A" entry for pecos is correct in WHM.
soundguy
Well, I managed to fix the problem on my box by manually restarting Bind. (I made a bunch of changes and apparently Cpanel didn't restart it successfully)
longtex
QUOTE (nature)
QUOTE (longtex)
You see the /etc/hosts above. /resolv.conf just has two ThePlanet dns servers' IPs in it. As far as I can tell, the "A" entry for pecos (as shown in whm) is correct.

Are you using ThePlanet's DNS for the domains on your server?

If the answer is "Yes", then your resolv.conf is correct. But you will need to get SM to add your A entry by going to the Orbit and requesting for that through the Domain Administration link.

However, if you are running your own DNS on that server, then you should have your DNS IPs in resolv.conf, in addition to making sure the "A" entry for pecos is correct in WHM.


Not sure what you mean. My understanding is that /etc/resolv.conf is used not to find pecos.mydomain.com but to find other domains when referenced by name rather than by IP address.

The confusion here comes from the use of "resolves" in the error message and the use of "pecos" by itself rather than "pecos.mydomain.com" - I have no effing idea where it's being looked for... /etc/resolv.conf doesn't say diddly squat about "pecos" with or without the domain; /etc/hosts does, but it does have the .186 entry, although it appears to be malformed; however, when I changed it manually, it got changed right back again. I'm suspecting that cPanel is doing this, but I haven't been able to figure out where it's getting the data it's using to change it...
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.