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.

Banging my head against a wall, nameservers.

Discussion in 'Bind / DNS / Nameserver Issues' started by slapstick, Oct 11, 2010.

  1. slapstick

    slapstick Member

    Joined:
    Oct 11, 2010
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    I have WHM and a single cpanel account setup within it. This is my own cpanel account and I don't resell. I have registered a domain with godaddy.com and my VPS host does not offer its own nameservers for use, so I've got to create my own. I thought I've done everything right but apparently not.

    Do I have to bother with resolv.conf? This is what's in it:

    Code:
    nameserver 174.137.xxx.xxx
    nameserver 174.137.xxx.xxx
    
    I only have one IP allotted to me, so I'm not sure why resolv.conf has two. Which is another question, I can't seem to add two nameservers in WHM because it says I have run out of IP's. I'm not new to WHM or Cpanel but configuring my own name servers has thrown me for a loop.
     
  2. 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
    First of all, at GoDaddy, you would need to register the private nameservers you are using. You can put them both onto the same IP. In your Domain Manager at GoDaddy, click on the domain, then scroll to the bottom and look at the far left hand corner. There will be a Hosts Summary (add) area. Click the add link. Enter ns1 in the first field, then the IP for the nameserver in the "Host IP 1" field. Click OK. Wait around 3-5 minutes and then add the second nameserver as ns2 with the same IP (it takes GoDaddy around that long to let you add a second one).

    After you have registered the private nameservers there, then change the domain's nameservers to those new ones in Nameservers > Set Nameservers section.

    After you've done the above, in cPanel, go to WHM > Basic cPanel/WHM Setup area and put your nameservers there. Click "Add an A entry for this nameserver" and enter the IP if it isn't the correct one, then click the "Add Entry" button. Do this for both nameservers.

    At that point, you should have working nameservers provided the private registration at GoDaddy has already propagated.

    Of note, the WHM > Nameserver IPs area doesn't do anything in regards to setting the A record or getting them working in cPanel. You don't even need to bother with using that area.

    Finally, in regards to your /etc/resolv.conf file, your IPs should not be in that file and, yes, that file does matter. Your resolver determines if your machine can resolve off-server domains, which it needs to do in order for email to function for one thing. The resolver is an off server location to resolve domains, so it isn't supposed to have your IPs in it. You could use a good public resolver instead in that file such as the 4.2.2.2 ones (I believe it's Level3 or VeriSign) or Google's resolvers:

    Level3
    nameserver 4.2.2.2
    nameserver 4.2.2.3

    Google
    nameserver 8.8.8.8
    nameserver 8.8.4.4
     
  3. slapstick

    slapstick Member

    Joined:
    Oct 11, 2010
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Okay that did clear up some things. Unfortunately I can only assign one IP when I'm doing the name servers part in basic setup. if I try to do ns2 I get a message telling me I've run out of IP's. I believe I've even set it to use the same IP for nameservers.

    Anyway, I notice now that my domain does in fact point to my host, but not my specific cpanel account. It points to a cpanel/apache style page. I've also noticed I can ping my site if I prefix it with www but not alone, such as domain.com

     
  4. slapstick

    slapstick Member

    Joined:
    Oct 11, 2010
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Ugh now the main site isn't resolving again either.

    Does the name servers I enter on godaddy need to be my main sites shared IP address? (Which is the only IP I have available) for the ns1 and ns2 name servers?

    What about Zone Files within WHM? Are those relevant for what I'm trying to do? How should those look?
     
  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
    The nameservers at your domain registrar (GoDaddy) should be the ones you registered using that domain.

    For the cPanel part, if the IP won't list to see it in WHM > Basic cPanel/WHM area, then simply go to WHM > Edit a DNS Zone and edit the zone for the domain name. The domain should have ns1 in it already for an A record. If it doesn't, then just put:

    ns1 14400 IN A IP#
    ns2 14400 IN A IP#

    Replace IP# with your IP address. Save the zone after editing it.

    Also, you have indeed created the domain as an account on the machine right? If not, it needs to be created.

    Finally, please ensure your hostname isn't the same as your domain name. The hostname for the machine needs to be a subdomain on the domain not the domain itself, so something like server.domain.com would work for the hostname. If you did use your main domain as the hostname, you can change it in WHM > Change Hostname area.
     
  6. slapstick

    slapstick Member

    Joined:
    Oct 11, 2010
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Okay, woohoo making progress. domain.net now loads. I can ping www.domain.net but it's not pointing to the site.
     
  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
  8. slapstick

    slapstick Member

    Joined:
    Oct 11, 2010
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Yep that's exactly what it was. Thanks!

    If I have the exact same domain, only in .com format, what would be the best way to have that direct to my site? Would I have to create a zone file for the .com alternate? I have 2 domains hosted on separate registrars. They're both the same but one is .com and the other is .net. Or would the best way to be to park the domain? Is this what I'd have to do?

    Go into other registrar and setup the nameservers and A NAME's the same way.
    Add a .com zone file the same as .net
    Park the domain in cpanel

    That right?
     
    #8 slapstick, Oct 11, 2010
    Last edited: Oct 11, 2010
  9. 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
    The best way is to park the domain in the cPanel account to point it to the same location.

    For the registrar part, correct, you'd change the nameservers to the ones you have for your server, and then the DNS zone added by parking the domain in cPanel will cause the domain to serve from that location.
     
  10. slapstick

    slapstick Member

    Joined:
    Oct 11, 2010
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Alright I've done it just waiting for the ns to update on the .com domain. You're the best, thanks.
     
  11. 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 are very welcome. I'm glad I could help on it. :) I remember back when I had to try to figure this stuff out myself, so I know how complicated it can be the first time to get everything working.
     
Loading...

Share This Page