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.

DNS only Cpanel invalid hostname

Discussion in 'Bind / DNS / Nameserver Issues' started by blaster701, Feb 17, 2012.

  1. blaster701

    blaster701 Member

    Joined:
    Mar 16, 2006
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Hi there. This issue is probably easy to solve; but I guess it involves modification of cpanel core config through SSH.

    I've deployed a new fresh server with CentOS x64 5.6 installation (DNS only installed afterwards). But... eventhough hostname is set as valid (IP dns.domain.com -> etc/hosts file) cprsrvd/WHM does not serve with the name, just with the IP and by no means in SSL (https://IP:2087 or https://dns.domain.com:2087)

    Hostname was set correctly at cpanel installation, server says it's dns.domain.com, but it refuses to actually use it as a virtual host for serving HTML, launching a "Can't Find server dns.LOCALDOMAIN."

    STEPS TAKEN
    1. Installed from image Cent OS 5.6 x64
    2. Disabled iptables, selinux. Upgraded all RPM via yum.
    3. Installed DNS-only Cpanel.

    Where can I find this config for cpanel within system folders? Or a script to rebuild config for cpsrvd?
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,451
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Not sure how much this matters, but this shouldn't have been needed. cPanel takes care of updating system software when you update cPanel.
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    It's likely the hostname does not yet resolve to an IP address. Check to make sure the "A" record is properly added for the hostname. You should do this on the server where you control the DNS for the parent domain name of your hostname.

    Thank you.
     
  4. blaster701

    blaster701 Member

    Joined:
    Mar 16, 2006
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Thanks Michael for the info. Yes, properly DNS records were set (tested by external nslookup) and hostname dns.domain.com resolved to IP. I found the mess... let's see if I can explain it properly...

    That server is named dns2.domain.com, an acts at the same time (has also DNS zone for) as ns2.domain.com... it's exactly the same setup as for other machine called dns1.domain.com (ns1.domain.com) which behaves as intented when requesting WHM. All zones are correct pointing to their IP addresses.

    However, in this "dns2" machine in order to access WHM via browser, you can't use the hostname but the nameserver (ns2), and despite it throws a "login error" after HTTP refresh it loads and autenticates successfully...

    This is what happens when trying to load WHM:
    http://dns2.domain.com (2086 or SSL 2087) -> ERROR can't login, tries to serve "dns2.localdomain" HTTP pages
    http://ns2.domain.com (2086 or SSL 2087) -> After login displays "login error", but a refresh via browser loads dns2.domain.com

    Something messed up during cpanel setup. I would like where to fix this, as I'm used to handle apache conf, but can't figure out how cpsrvd is configured. Probably as ns2 zone was created previously than dns2 (in the cluster) it has considered ns2 as the virtual host to setup.

    Many thanks in advance,
     
  5. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    What do you have in /etc/hosts file specifically? Please post the contents of that file.

    Next, what is in /etc/resolv.conf file? If possible, try changing the resolvers to good public ones:

    Code:
    nameserver 8.8.4.4
    nameserver 8.8.8.8
    Those would be the Google public resolvers you can use for checking the DNS detection isn't the issue.

    Finally, what is in /etc/sysconfig/network file?
     
  6. blaster701

    blaster701 Member

    Joined:
    Mar 16, 2006
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    I really appreciate your help, it's not a serious issue (server works perfectly) but I'm just wondering if it could bring trouble sooner or later.
    I always use google public DNS... for me the line "domain localdomain" sounds weird in resolv.conf. Should I get rid of it?

    /etc/hosts
    127.0.0.1 localhost
    X.X.X.X dns2.domain.com dns2

    (where X.X.X.X is server's IP -> OK)

    cat /etc/resolv.conf
    domain localdomain
    nameserver 8.8.8.8
    nameserver 8.8.4.4

    /etc/sysconfig/network
    NETWORKING="yes"
    NETWORKING_IPV6="no"
    GATEWAY="Y.Y.Y.Y"
    HOSTNAME=dns2.domain.com
    DOMAINNAME=domain.com

    (where Y.Y.Y.Y is LAN router IP -> OK)
     
  7. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    You could get rid of the "domain localdomain" line in /etc/resolv.conf file. I don't see anything wrong with the other files.
     
  8. blaster701

    blaster701 Member

    Joined:
    Mar 16, 2006
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    All right, that was the problem. When server received DNS request for dns2, it automatically answered localdomain because it was configured in resolv.conf, without asking public nameservers.

    Many thanks, Tristan, have a great day!
     
Loading...

Share This Page