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.

IP check, dns resolves correctly but WHM warns wrong

Discussion in 'Bind / DNS / Nameserver Issues' started by phicts, Apr 30, 2013.

  1. phicts

    phicts Active Member

    Joined:
    Feb 8, 2013
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    I believe my dns settings are correct as per intodns and another online dns reporting site. My three sites hosted on the same vps are also working fine and resolving.

    My server provider assigned me two IPs:
    xxx.xxx.xxx.x1 which is my primary IP and,
    xxx.xxx.xxx.x2

    In my domain registrar (namecheap), my nameservers are as follows:
    dns1.mydomain.tld set to xxx.xxx.xxx.x1
    dns2.mydomain.tld set to xxx.xxx.xxx.x2

    In WHM, i have also the same settings in the Basic Setup, with A record set by clicking the Set A record button for each nameserver.
    dns1.mydomain.tld set to xxx.xxx.xxx.x1
    dns2.mydomain.tld set to xxx.xxx.xxx.x2

    However, cpanel emails me that,

    I have already edited my /etc/hosts so that that my hostname and IP is used. So where where do i set in WHM so that it will set as is and not as it wants me to do?

    I am running Centos 6 latest version, 64-bit with WHM 11.36. Thanks in advance.
     
  2. phicts

    phicts Active Member

    Joined:
    Feb 8, 2013
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    my /etc/resolv.conf looks like this

    which i do not want to edit as much as possible because if i replace them with my assigned IP, i will lose some functionalities in the DNS settings.

    EDIT: SORRY for typing it as /etc/hosts in my original post.
     
    #2 phicts, Apr 30, 2013
    Last edited: May 1, 2013
  3. phicts

    phicts Active Member

    Joined:
    Feb 8, 2013
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    and here's what my /etc/hosts looks like

    Code:
    ::1		localhost localhost.localdomain localhost6 localhost6.localdomain6
    127.0.0.1		localhost.localdomain localhost localhost4.localdomain4 localhost4
    # Auto-generated hostname. Please do not remove this comment.
    xxx.xxx.xxx.x1		hostname
    xxx.xxx.xxx.[B]x2[/B]		hostname.domain.tld hostname
    
    uhm, looks like i need to edit the .x2 entry, right?
    so how should it look like once i edit it? delete the x1 entry/line and change x2 to x1 in the last line? Thanks in advance.
     
  4. quietFinn

    quietFinn Well-Known Member

    Joined:
    Feb 4, 2006
    Messages:
    998
    Likes Received:
    10
    Trophy Points:
    18
    Location:
    Finland
    cPanel Access Level:
    Root Administrator
    Yes that's right.

    After that run:
    Code:
    /scripts/ipcheck --verbose
    
    .
     
  5. phicts

    phicts Active Member

    Joined:
    Feb 8, 2013
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    I manually edited my /etc/hosts to look like this,

    Code:
    ::1		localhost localhost.localdomain localhost6 localhost6.localdomain6
    127.0.0.1		localhost.localdomain localhost localhost4.localdomain4 localhost4
    xxx.xxx.xxx.[B]x1[/B]		hostname.domain.tld hostname
    
    removing the two lines,
    Code:
    #auto-generated... 
    xxx.xxx.xxx.x1		hostname
    then i restarted DNS and run,

    Code:
    /scripts/ipcheck --verbose

    and i got the same issue in the e-mail / notice - that it resolved to ...x1 but should resolve to x2 :-(
     
  6. phicts

    phicts Active Member

    Joined:
    Feb 8, 2013
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    In WHM Basic setup, my main IP is set to x.x.x.x1 but in the Add A entry under DNS function, it says my main IP is set to x.x.x.x2 so in the box below "Please confirm the IP address to use for the "A Entry" for hostname.mydomain.tld, i typed in
    x.x.x.x1 and press the button.

    The result says,
    But this process do not actually take effect. When i recheck "add a entry to your hostname..." it still displays x.x.x.x2 as my primary IP and the same A record as x.x.x.x2 instead of my real primary ip which is x.x.x.x1 which also should be the one to which the A record must be set.
     
  7. quietFinn

    quietFinn Well-Known Member

    Joined:
    Feb 4, 2006
    Messages:
    998
    Likes Received:
    10
    Trophy Points:
    18
    Location:
    Finland
    cPanel Access Level:
    Root Administrator
    Edit the DNS zone of the domain mydomain.tld and change the A record for your hostname to point to the correct IP.

    Personally I never use those "Assign IP address" & "Add an A entry..." buttons, I edit DNS zones manually.
     
  8. simonas

    simonas Well-Known Member

    Joined:
    Apr 21, 2013
    Messages:
    141
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Lithuania
    cPanel Access Level:
    Root Administrator
    That's how /etc/resolv.conf must look like.

    Did you rewrite your /etc/hosts ?
     
  9. phicts

    phicts Active Member

    Joined:
    Feb 8, 2013
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Everything in my mydomain.tld points correctly to x.x.x.x1 which is my primary IP and licensed IP. The only entry for x.x.x.x2 there is for dns2.mydomain.tld which i believe is correct.

    How do I manually edit the A record of my hostname? I mean which file do i edit other than /etc/hosts?

    What does /etc/resolv.conf look like exactly? mine points to 8.8.8.8 and 8.8.4.4 as i would lose some DNS functionalities if i change it to assigned IP's

    I did rewrite my /etc/hosts as you can see above.
     
  10. quietFinn

    quietFinn Well-Known Member

    Joined:
    Feb 4, 2006
    Messages:
    998
    Likes Received:
    10
    Trophy Points:
    18
    Location:
    Finland
    cPanel Access Level:
    Root Administrator
    There is one and only place, the DNS zone of the domain.
    If your hostname is hostname.domain.tld then you edit the A record of it in the DNS zone of the domain domain.tld.
     
  11. phicts

    phicts Active Member

    Joined:
    Feb 8, 2013
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    But like i said, it's already set correctly. The entries for A record looks like:

    Code:
    hostname.domain.tld. NS dns1.domain.tld
    hostname.domain.tld. NS dns2.domain.tld
    hostname.domain.tld. A  x.x.x.x1
    localhost	             A  127.0.0.1
    hostname                A  x.x.x.x1
    for the main domain, the only reference to x.x.x.x2 is for the dns2.domain.tld :-(
     
  12. phicts

    phicts Active Member

    Joined:
    Feb 8, 2013
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Do you mean i should add

    Code:
    hostname.mymaindomain.tld. 14400 IN A X.X.X.X1
    to the DNS zone of mymaindomain.tld? it appears in the DNS Zone record of my hostname.mymaindomain.tld but that entry is missing in the DNS Zone record of my main domain (mymaindomain.tld). is it the solution or doesn't really matter?
     
  13. simonas

    simonas Well-Known Member

    Joined:
    Apr 21, 2013
    Messages:
    141
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Lithuania
    cPanel Access Level:
    Root Administrator
    Ok let's start from the beginning.

    If it's true what you are saying, of course it won't work.
    Resolv.conf is used only for resolving outgoing queries, so open

    /etc/resolv.conf

    and paste

    Save file.

    Then open your /etc/hosts
    Paste this text:
    Change the "256.158.67.48" with your server's IP and subdomain and domain keywords. For example if you have hostname : host.example.com, that line would be:

    Save the file, restart the server.

    Now let's talk why you want to change IP of the second nameserver?
    Namecheap allows both nameservers same IP.

    Different IPs, same server, still single point of failure.
    I would advise to keep that spare IP for the SSL websites.

    If you still insist that second nameserver would have different IP:

    In WHM:
    GO to Delete a DNS Zone,
    search for the ns2.yourdomain.com or whatever you named your second nameserver. If it's not there go to the next step, if it is there - Delete that zone.

    Go to Basic cPanel & WHM Setup

    On the bottom
    Nameserver 2: Click Assign IP address.
    Then Add an A entry for this nameserver. ATTENTION!! Check if THE IP of the second nameserver is correct in the box. If not, paste it there and save it.
    Click Save on the bottom.

    This will save settings for the new users.

    Now go to Edit DNS Zone
    check if you see here your ns2.yourdomain.com.

    Now, depending how you initially set up your server, other domain zones might have nameservers IPS in them, but they might have only nameserver names, like:

    someDomain.com. 1000 NS ns1.maindomain.com
    someDomain.com. 1000 NS ns2.maindomain.com

    If you see there records like:
    ns2.maindomain.com A SERVERIP - change that IP .

    If you don't see - leave it.

    If you did not screw up other DNS zones, it should work now.

    You might want to Add an A Entry for Your Hostname .

    Restart NAMED (DNS) service after manipulating DNS zones for changes to come into effect.
     
    #13 simonas, May 1, 2013
    Last edited: May 1, 2013
  14. phicts

    phicts Active Member

    Joined:
    Feb 8, 2013
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Hi simonas. Thank you for your comprehensive reply. I'm sorry for my mistake to type that my /etc/hosts looks like 8.8.8.8 and 8.8.4.4 when it is actually my /etc/resolv.conf file.

    the rest of your pointers, i believe i've already done. thanks again.
     
  15. quietFinn

    quietFinn Well-Known Member

    Joined:
    Feb 4, 2006
    Messages:
    998
    Likes Received:
    10
    Trophy Points:
    18
    Location:
    Finland
    cPanel Access Level:
    Root Administrator
    If the hostname is host.domain.tld then the A record for host.domain.tld is in the DNS zone of the domain domain.tld.

    In another reply you say you have:

    Code:
    hostname.domain.tld. NS dns1.domain.tld
    hostname.domain.tld. NS dns2.domain.tld
    hostname.domain.tld. A  x.x.x.x1
    localhost	             A  127.0.0.1
    hostname                A  x.x.x.x1
    
    that is WRONG.

    It should be:
    Code:
    domain.tld. NS dns1.domain.tld.
    domain.tld. NS dns2.domain.tld.
    dns1           A  x.x.x.x1
    dns2           A  x.x.x.x2
    hostname    A  x.x.x.x1
    localhost	 A  127.0.0.1
    
     
  16. phicts

    phicts Active Member

    Joined:
    Feb 8, 2013
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Thank you quietFinn. but all my settings are confirmed correct. What i actually needed to do was just change my primary IP by logging to SSH and edit
    /etc/sysconfig/network-scripts/ifcfg-eth0 (in my case, on virtuozzo, it was actually /ifcf-venet0:0

    I changed the x.x.x.x2 reference there to x.x.x.x1
    run
    Code:
    service network restart
    and that solved it.

    i did have to reactivate my cPanel license in the process.

    this how-to on how to change the primary IP address of WHM/cPanel server saved the day for me.

    what i learned is that in my case, that Basic Setup in WHM does not always work. too bad.
     
  17. simonas

    simonas Well-Known Member

    Joined:
    Apr 21, 2013
    Messages:
    141
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Lithuania
    cPanel Access Level:
    Root Administrator
    Basic Setup should work all the time. Are you sure you clicked Save Changes at the bottom and no errors were displayed?

    If you are talking about nameservers on that page: The root account’s default nameservers used when root creates an account.

    Anyway, glad you have solved it. Good luck.
     
  18. quietFinn

    quietFinn Well-Known Member

    Joined:
    Feb 4, 2006
    Messages:
    998
    Likes Received:
    10
    Trophy Points:
    18
    Location:
    Finland
    cPanel Access Level:
    Root Administrator
    If your DNS zone is as you showed in your earlier post then it is not correct.
     
  19. phicts

    phicts Active Member

    Joined:
    Feb 8, 2013
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    This is CORRECT and this is my settings for my main domain.tld

    - - - Updated - - -

    Do you have a DNS zone for your hostname.maindomain.tld? may i know what it looks like? Thanks.
     
  20. quietFinn

    quietFinn Well-Known Member

    Joined:
    Feb 4, 2006
    Messages:
    998
    Likes Received:
    10
    Trophy Points:
    18
    Location:
    Finland
    cPanel Access Level:
    Root Administrator
    Yes that is right, but in post #11 you told it's like this:

    Code:
    hostname.domain.tld. NS dns1.domain.tld
    hostname.domain.tld. NS dns2.domain.tld
    hostname.domain.tld. A  x.x.x.x1
    localhost	             A  127.0.0.1
    hostname                A  x.x.x.x1
    
    I don't understand what you mean by "maindomain". In a dedicated server (or VPS) there is not such a thing as "main domain".

    I do not have a DNS zone for the hostname of the server, instead I always have the A record for the hostname in the DNS zone of the hostname's domain.
     
Loading...

Share This Page