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.

Problems with hostname.

Discussion in 'Bind / DNS / Nameserver Issues' started by Spork Schivago, May 28, 2016.

Tags:
  1. Spork Schivago

    Spork Schivago Well-Known Member

    Joined:
    Jan 21, 2016
    Messages:
    292
    Likes Received:
    24
    Trophy Points:
    18
    Location:
    corning, ny
    cPanel Access Level:
    Website Owner
    Not sure this is the right place to post this, but since I've had cPanel setup, I've occasionally gotten these e-mails, which are a bit weird. Not really sure what's going on here. Here's what the first one says:

    Code:
    The system detected an invalid hostname configuration on: hostname.domain.com
    The main IP address of your cPanel & WHM server is “<my ip address>”. The hostname does not resolve to thisIP address. This misconfiguration can cause some services on your server to fail to restart properly. The cause of your misconfiguration is:
    
    
    
    WHM has detected a manual hostname change.
    
    
    To fix this problem, we recommend that you perform the following action:
    
    
    
    The system will attempt to synchronize the current hostname “hostname.domain.com” to the system configuration. In the future, update your hostname in WHM’s (http://hostname.domain.com:2087/scripts2/changehostname) interface (Home » Networking Setup » Change Hostname).
    
    
    
    
    This notice is the result of a request from “server_hostname_validator”.
    The system generated this notice on Saturday, May 28, 2016 at 4:59:39 AM UTC.
    
    “Invalid Hostname For Main IP Address” notifications are currently configured to have an importance of “High”. You can change the importance or disable this type of notification in WHM’s Contact Manager at:https://hostname.domain.com:2087/scripts2/editcontact?event=Check::ValidServerHostname
    
    Do not reply to this automated message.
    
    
    If I ping hostname.domain.com, it does match the IP address listed. Always, right after this e-mail, I get another one that says:

    Code:
    
    The server recently changed hostname from “hostname.domain.com” to “hostname.domain.com”. As part of this change, a background task was launched to update the hostname in individual users' Horde databases. The outcome of this task was: Success.
    
    No action is required on your part.
    
    Additional detail:
    
    [2016-05-28 01:02:05 -0400] info [/usr/local/cpanel/scripts/dav_change_hostname] The system will now change the calendar and address book hostnames from “hostname.domain.com” to “hostname.domain.com”.
    [2016-05-28 01:02:05 -0400] info [/usr/local/cpanel/scripts/dav_change_hostname] The system successfully updated the hostnames for all 1 users.
    The system generated this notice on Saturday, May 28, 2016 at 5:02:05 AM UTC.
    
    “Hostname Change Notifications” notifications are currently configured to have an importance of “Low”. You can change the importance or disable this type of notification in WHM’s Contact Manager at:https://hostname.domain.com:2087/scripts2/editcontact?event=DAV::ChangeHostname
    
    Do not reply to this automated message.
    
    
    I don't understand. cPanel is changing hostname.domain.com to hostname.domain.com? There's no difference! I've gone to the links, I've verified the hostname was set correctly...not sure what's going on here but I'd like to fix the issue. Thanks!
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    Please post the output from the following command:

    Code:
    grep '' /etc/redhat-release /usr/local/cpanel/version /var/cpanel/envtype ; grep CPANEL= /etc/cpupdate.conf
    Thank you.
     
  3. Spork Schivago

    Spork Schivago Well-Known Member

    Joined:
    Jan 21, 2016
    Messages:
    292
    Likes Received:
    24
    Trophy Points:
    18
    Location:
    corning, ny
    cPanel Access Level:
    Website Owner
    Thank you!

    Code:
    root@franklin:[/home/sporkschivago]# grep '' /etc/redhat-release /usr/local/cpanel/version /var/cpanel/envtype ; grep CPANEL= /etc/cpupdate.conf
    /etc/redhat-release:CentOS release 6.8 (Final)
    /usr/local/cpanel/version:11.56.0.22
    /var/cpanel/envtype:virtuozzo
    CPANEL=release
    
    
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Do you notice the issue after the system reboots? If so, ensure you are using the same hostname in your VPS management interface from your VPS hosting provider.

    Thank you.
     
  5. Spork Schivago

    Spork Schivago Well-Known Member

    Joined:
    Jan 21, 2016
    Messages:
    292
    Likes Received:
    24
    Trophy Points:
    18
    Location:
    corning, ny
    cPanel Access Level:
    Website Owner
    Let me reboot the system and see. From what I can tell, there's something I do, but I don't think it's rebooting, that causes it. When I start playing with settings in WHM. Maybe it's something I'm doing. I want to say the last time was when I was messing with sub-domains, I got the e-mail. I'll try doing a restart right now of the server and see if I get it.

    The VPS management interface (the GoDaddy stuff, right?) that has the hostname setup correctly, Franklin. I mean, in GoDaddy, it's a capital F, like I feel it should be. Would that matter? I didn't think of that until now. With Linux, capitalization means a lot. Also, with the web, it seems capitalization means a lot. I wanted my domain name to actually be JetBBS not jetbbs. Even if I try to refer to it as JetBBS, in some places, that breaks things. I gotta use the all lower case one. Maybe I need to change the hostname on GoDaddy to all lower case?
     
  6. Spork Schivago

    Spork Schivago Well-Known Member

    Joined:
    Jan 21, 2016
    Messages:
    292
    Likes Received:
    24
    Trophy Points:
    18
    Location:
    corning, ny
    cPanel Access Level:
    Website Owner
    I might have found the problem. There was a new update to cPanel / WHM and I went to update. Combing through the logs, I notice this:

    Code:
    [2016-06-08 18:31:18 -0400] Processing: Checking for main IP changes
    [2016-06-08 18:31:18 -0400] - Processing command `/usr/local/cpanel/scripts/mainipcheck`
    [2016-06-08 18:31:18 -0400] Processing: Validating server hostname
    [2016-06-08 18:31:18 -0400] - Processing command `/usr/local/cpanel/scripts/check_valid_server_hostname --notify`
    [2016-06-08 18:31:18 -0400] [2363] ERROR: WHM has detected a manual hostname change.
    [2016-06-08 18:31:18 -0400] [2363]
    [2016-06-08 18:31:18 -0400] [2363] The system will attempt to synchronize the current hostname “franklin.domain.com” to the system configuration. In the future, update your hostname in WHM’s (http://franklin.domain.com:2087/scripts2/changehostname) interface (Home » Networking Setup » Change Hostname).
    [2016-06-08 18:33:43 -0400] [2363] Changing hostname to franklin.domain.com...Success!
    [2016-06-08 18:33:43 -0400] [2363]
    [2016-06-08 18:33:43 -0400] [2363] Hostname set to: franklin.domain.com
    [2016-06-08 18:33:43 -0400] [2363] Warnings were seen during rename:
    [2016-06-08 18:33:43 -0400] [2363]
    [2016-06-08 18:33:43 -0400] [2363] The hostname was already set to franklin.domain.com, syncing configuration only.
    [2016-06-08 18:33:43 -0400] [2363]
    [2016-06-08 18:33:43 -0400] [2363] Output during rename:
    [2016-06-08 18:33:43 -0400] [2363]
    
    It seems somewheres my domain name is set to the capitalized domain. Originally when I tried registering the name, I tried capitalization but certain things, like Let's Encrypt, didn't like it, so I used lower case. Where would I change something like that? Ultimately, I'd like the capitalized version to be the correct version, but if it's going to cause problems, I'll use completely lower case. But where would I change that? Thanks!
     
    #6 Spork Schivago, Jun 8, 2016
    Last edited by a moderator: Jul 12, 2016
  7. Spork Schivago

    Spork Schivago Well-Known Member

    Joined:
    Jan 21, 2016
    Messages:
    292
    Likes Received:
    24
    Trophy Points:
    18
    Location:
    corning, ny
    cPanel Access Level:
    Website Owner
    I wanted to add, I found this in /etc/hosts:

    127.0.0.1 localhost franklin.domain.com franklin


    Could that be where it's picking up domain.com ? I tried looking on GoDaddy's site but couldn't find anything. Everything's either all capital (DOMAIN.COM) or all lowercase (domain.com). I now just edited /etc/hosts and changed it to lowercase but there was a message in that file, a comment. Here's the full file

    Code:
    127.0.0.1               localhost.localdomain localhost
    ::1             localhost localhost6 localhost6.localdomain6
    
    172.19.xxx.xxx          domain
    104.238.117.105         franklin.domain.com franklin domain.secureserver.net domain
    # Auto-generated hostname. Please do not remove this comment.
    127.0.0.1               localhost franklin.domain.com franklin
    
    That's after I modified it. I wonder if I can remove that dang domain.secureserver.net stuff. Everything was set there by default when I started. And somehow, GoDaddy is tied into secureserver.net but I don't think that domain.secureserver.net is a real server. Maybe it's just left over? I'd like to get rid of that junk if I could.
     
    #7 Spork Schivago, Jun 8, 2016
    Last edited by a moderator: Jul 12, 2016
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    You should be able to simply update the hostname to use all lowercase characters via:

    "WHM >> Change Hostname"

    This will ensure the hostname change is synced throughout all of the configuration files. The one exception is the VPS configuration itself, as you may need to update the hostname with your VPS provider to ensure it also uses all lowercase characters. Let us know if this is not working.

    Thank you.
     
  9. Spork Schivago

    Spork Schivago Well-Known Member

    Joined:
    Jan 21, 2016
    Messages:
    292
    Likes Received:
    24
    Trophy Points:
    18
    Location:
    corning, ny
    cPanel Access Level:
    Website Owner
    Thanks, I had used the WHM >> Change Hostname many times. Every time I got the error message, in fact. That didn't seem to fix it. I had also tried changing the VPS configuration to all lower case. I believe this was in fact the problem. I could see where it was listing DOMAIN instead of domain but I couldn't find anyplace to change it. Once I manually edited /etc/hosts and changed it to all lower case, I rebooted the server and haven't ran across the message since. I think that was the problem.

    Any ideas if I can remove that secureserver.net stuff from the /etc/hosts file or don't you know? I know in the DNS zone files or whatever they're called, I had to remove the secureserver.net stuff and replace it with my real domain name. I don't think it's supposed to be in the /etc/hosts file but I'm not 100% certain. What do you think? I know in the real world, domain.secureserver.net doesn't seem to exist. I can't ping it, I can't go there, I can't do a reverse DNS lookup on it or anything like that. I can ping it on my server, but that's only because it's in the hosts file I believe. What do you think? Safe to remove? Thanks for all the help!
     
    #9 Spork Schivago, Jul 5, 2016
    Last edited by a moderator: Jul 12, 2016
  10. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    You can remove the entry if you have no need to resolve that domain name to the specified IP address. It's likely listed because it was the original server hostname.

    Thank you.
     
    Spork Schivago likes this.
  11. Spork Schivago

    Spork Schivago Well-Known Member

    Joined:
    Jan 21, 2016
    Messages:
    292
    Likes Received:
    24
    Trophy Points:
    18
    Location:
    corning, ny
    cPanel Access Level:
    Website Owner
    Thanks cPanelMichael! I believe you're right. I ended up removing it and nothing seemed to break, so that's good. There were a few secureserver.net references left over that I should had removed but didn't know that I was supposed to. I know my hosting providers require me to go through some dedrely.secureserver.net to make sure I don't do bad stuff with e-mail and they say if I try to by-pass that, I can get in all kinds of trouble. I was afraid maybe this had something to do with that, but I'm almost positive now it doesn't. Thanks again for the help!

    I'm glad I can always count on cPanel professionals for help when I need it!
     
  12. Spork Schivago

    Spork Schivago Well-Known Member

    Joined:
    Jan 21, 2016
    Messages:
    292
    Likes Received:
    24
    Trophy Points:
    18
    Location:
    corning, ny
    cPanel Access Level:
    Website Owner
    Dang,

    I just ran /scripts/upcp --force and got the message again. I got two of them. This is what it says:

    Code:
    [franklin.domain.com] The system detected an invalid hostname configuration.
    The system detected an invalid hostname configuration on: franklin.domain.com
    The main IP address of your cPanel & WHM server is “104.238.xxx.xxx”. The hostname does not resolve to this IP address. This misconfiguration can cause some services on your server to fail to restart properly. The cause of your misconfiguration is:
    
    
    
    WHM has detected a manual hostname change.
    
    
    To fix this problem, we recommend that you perform the following action:
    
    
    
    The system will attempt to synchronize the current hostname “franklin.DOMAIN.com” to the system configuration. In the future, update your hostname in WHM’s (http://franklin.domain.com:2087/scripts2/changehostname) interface (Home » Networking Setup » Change Hostname).
    
    
    
    
    This notice is the result of a request from “server_hostname_validator”.
    The system generated this notice on Monday, July 11, 2016 at 7:13:39 PM UTC.
    
    “Invalid Hostname For Main IP Address” notifications are currently configured to have an importance of “High”. You can change the importance or disable this type of notification in WHM’s Contact Manager at:https://franklin.domain.com:2087/scripts2/editcontact?event=Check::ValidServerHostname
    
    Do not reply to this automated message.
    
    
    Code:
    [franklin.domain.com] Hostname change status
    
    The server recently changed hostname from “franklin.domain.com” to “franklin.domain.com”. As part of this change, a background task was launched to update the hostname in individual users' Horde databases. The outcome of this task was: Success.
    
    No action is required on your part.
    
    Additional detail:
    
    [2016-07-11 15:16:20 -0400] info [/usr/local/cpanel/scripts/dav_change_hostname] The system will now change the calendar and address book hostnames from “franklin.domain.com” to “franklin.domain.com”.
    [2016-07-11 15:16:20 -0400] info [/usr/local/cpanel/scripts/dav_change_hostname] The system successfully updated the hostnames for all 1 users.
    The system generated this notice on Monday, July 11, 2016 at 7:16:20 PM UTC.
    
    “Hostname Change Notifications” notifications are currently configured to have an importance of “Low”. You can change the importance or disable this type of notification in WHM’s Contact Manager at:https://franklin.domain.com:2087/scripts2/editcontact?event=DAV::ChangeHostname
    
    Do not reply to this automated message.
    
    It looks like somehow my manual changes to /etc/hosts got changed again. Here's what it shows now:
    Code:
    #/etc/hosts file
    127.0.0.1               localhost.localdomain localhost
    ::1             localhost localhost6 localhost6.localdomain6
    
    172.19.120.223          domain
    104.238.117.105         franklin.domain.com franklin domain
    # Auto-generated hostname. Please do not remove this comment.
    127.0.0.1               localhost franklin.DOMAIN.com franklin
    
    I just wanted to confirm, this is definitely something with GoDaddy's stuff, right? Somewheres in the user interface, my domain is listed as DOMAIN.com, not domain.com, right? I just gotta figure out where and how to change it to lowercase, right?
     
    #12 Spork Schivago, Jul 11, 2016
    Last edited by a moderator: Jul 12, 2016
  13. Spork Schivago

    Spork Schivago Well-Known Member

    Joined:
    Jan 21, 2016
    Messages:
    292
    Likes Received:
    24
    Trophy Points:
    18
    Location:
    corning, ny
    cPanel Access Level:
    Website Owner
    I'm making progress. In GoDaddy, I had to do some weird stuff and I noticed there was a name for the server, but the hostname value was empty. So, what I did was set the hostname to franklin.domain.com and it took a while to update. It looked like it was broke. Then I got an e-mail from lfd saying there was a root login from a domain that looked like one of the GoDaddy support people. I cat /etc/hosts and now the very last two lines, the auto-generated ones, they're missing. So, I think I'm getting somewheres. Hopefully they become properly populated soon. I'll keep ya posted!
     
    #13 Spork Schivago, Jul 11, 2016
    Last edited by a moderator: Jul 12, 2016
  14. Spork Schivago

    Spork Schivago Well-Known Member

    Joined:
    Jan 21, 2016
    Messages:
    292
    Likes Received:
    24
    Trophy Points:
    18
    Location:
    corning, ny
    cPanel Access Level:
    Website Owner
    I think I'm good. The GoDaddy interface shows the server update is complete. The auto-generated stuff is just completely gone from /etc/hosts.

    I don't see how that could cause problems. I guess maybe it could. If a local program is trying to connect to franklin.domain.com, instead of connecting to 127.0.0.1, the local loopback, it'll connect to 104.238.xxx.xxx, right? Would that mean if someone had a sniffer running somewheres that wasn't on my server, they'd be able to see the traffic? And before, because the /etc/hosts had franklin.domain.com pointing to the local loopback, any local program would just connect to 127.0.0.1 and not go over the internet? Thanks!
     
    #14 Spork Schivago, Jul 11, 2016
    Last edited by a moderator: Jul 12, 2016
  15. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    The system uses the /etc/hosts file to determine the IP address associated with a hostname before consulting with the name servers. This only applies to local connections. Remote servers do not consult with your system's /etc/hosts file. There's a full document on this at:

    17.9. Managing Hosts

    Thank you.
     
Loading...

Share This Page