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.

Relationships between Hostname et al.

Discussion in 'General Discussion' started by mike73, May 9, 2006.

  1. mike73

    mike73 Member

    Joined:
    May 4, 2006
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    I'm having difficulty understanding the relationships between Hostname (Server Configuration) Hostname (Networking Setup), DNS zones and nameservers.

    I have a clean dedicated server with CentOS 4.3 i686 - WHM X v3.1.0. I'll be running my own nameservers. I've already updated the registrar and it's propigated. Please tell me what I'm doing wrong:

    1) Server Configuration/Basic cPanel/WHM Setup:
    I set Hostname to server.mydomain.com, the nameservers to ns1.mydomain.com and ns2.mydomain.com, and clicked the buttons to assign IPs and create A entries.

    2) Networking Setup/Hostmname: This is where I already start getting confused ;)
    I put server.mydomain.com here too. Am I doing this right so far, or was I only supposed to have mydomain.com or www.mydomain.com in step one?

    3) Networking Setup/Nameserver IPs
    Nothing strange here. Assigned my first 2 IPs to ns1.mydomain.com and ns2.mydomain.com.

    4) Networking Setup/Resolver Configuration
    According to the people I rent the server from, I don't have to set this up because "No need to use upstream resolvers since you are running your own nameservers."

    5) DNS Functions/Edit DNS Zone:
    I now have 3 zones, one for server.mydomain.com, and one for each nameserver (ns1.mydomain.com and ns2.mydomain.com). Is this really how it's supposed to be?
    The server.biosocket.com zone looks weird. It has "server" in front of everything. For example:
    server.mydomain.com. 86400 IN NS ns1.mydomain.com

    And now I need to make an account too right? Should it just be called "mydomain.com"? That's what I did, but something is wrong. Everything in the Parent category passes at dnsreport.com, but the first NS report yields "A timeout occurred getting the NS records from your nameservers!"
     
  2. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    Can you clarify what you mean by this? You might have missed something important there!
     
  3. mike73

    mike73 Member

    Joined:
    May 4, 2006
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    Thanks for the quick reply.

    I have my names registered at networksolutions. I changed the DNS there so it points to ns1 and ns2.mydomain.com with the corresponding IPs on my new server.
     
  4. mike73

    mike73 Member

    Joined:
    May 4, 2006
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    btw, my Main Shared Virtual Host IP is the same as ns1.mydomain.com. Is that OK?
     
  5. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    To be a little more clear, you mean you set up glue records for ns1 and ns2 at the registrar?

    What IP addresses do ns1 and ns2 resolve to? The correct IPs?
     
  6. mike73

    mike73 Member

    Joined:
    May 4, 2006
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    Glue what? Sorry, I don't know what that is. :eek:

    ns1 resolves to the main server IP. ns2 resolves to an extra IP. Both are also assigned as nameserver IPs.
     
  7. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    Glue records are very much like A records except that they exist at the registrar level and ensure that ns1 and ns2 resolve to the IPs you choose regardless of what the domain level A records actually state for ns1 and ns2.

    You might want to check with your registrar that what you have set up are indeed glue records as (excuse the pun) you're going to be stuck without them.

    Once you have glue records in place and they are resolving to the correct IPs, you need to ensure that you have A records created for the domain on your server and that you have the nameserver running.

    If you're willing to mention the domain name in question others may be able to check what the situation is for them.

    As for the DNS zone on your server, you should have the following:

    example.com 86400 IN NS ns1.example.com.
    example.com 86400 IN NS ns2.example.com.
    example.com 14400 IN A {main IP}

    ns1.example.com. IN A {primary DNS IP}
    ns2.example.com. IN A {secondary DNS IP}

    That is, of course, as well as all the other records in the zone.

    ns1.example.com and ns2.example.com have to exactly match the glue records at the registrar, as do the IP addresses in the last two A records shown above.

    Note the trailing dot after ns1 and ns2.example.com - things won't work without this!

    If you have the glue records set up correctly at the registrar and, as a bare minimum, the abovel records in the zone for the domain and you have your nameserver up and running correctly then everything should work, assuming you've given everything sufficient time to propagate. And assuming you're not running a firewall on the server that could be blocking connections to the nameserver (I believe port 53 should be open to incoming connections).
     
  8. mike73

    mike73 Member

    Joined:
    May 4, 2006
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    webignition, thank you very much for the detailed answer.

    Yes, I do have the glue records set up properly. Thanks for the clarification.

    I think I might know what I've been doing wrong. Currently, I have a DNS zone for each name server (ns1 and ns2.mydomain.com), a DNS zone for the hostname (server.mydomain.com) and a DNS zone for the main domain (mydomain.com). But it sounds like maybe I should only have one DNS zone (mydomain.com) with the combined records of the other zones. Is that correct?
     
    #8 mike73, May 10, 2006
    Last edited: May 10, 2006
  9. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    Correct, all should be in one DNS zone file.

    Here's an exact copy (with certain details replaced) of my main domain's DNS zone:

    Code:
    ; Modified by Web Host Manager
    ; Zone File for example.com
    $TTL 14400
    @	86400	IN	SOA	ns1.example.com.	dns.example.com.	(
    					2006030913
    					43200
    					7200
    					2419200
    					86400
    					)
    
    example.com.	86400	IN	NS	ns1.example.com.
    example.com.	86400	IN	NS	ns2.example.com.
    
    example.com.	14400	IN	A	{main IP}
    
    localhost.example.com.	14400	IN	A	127.0.0.1
    
    example.com.	14400	IN	MX	0	example.com.
    
    mail	14400	IN	CNAME	example.com.
    www	14400	IN	CNAME	example.com.
    ftp	14400	IN	A	{main IP}
    hostname	14400	IN	A	{main IP}
    ns1.example.com.	14400	IN	A	{primary DNS IP (commonly same as main IP)}
    ns2.example.com.	14400	IN	A	{secondary DNS IP}
    If your server's hostname is foobar.example.com, you'd need to replace 'hostname' with 'foobar'.

    You might want to first make a copy of the existing zone files in case you make a mistake merging them all together.

    If you're running a RH-based OS:

    cp /var/named/ns1.example.com.db /var/named/ns1.example.com.db.backup
    cp /var/named/ns2.example.com.db /var/named/ns2.example.com.db.backup
    cp /var/named/hostname.example.com.db /var/named/hostname.example.com.db.backup
    cp /var/named/example.com.db /var/named/example.com.db.backup

    Then through WHM, delete the zones for ns1.example.com, ns2.example.com and hostname.example.com and add all the correct entries into the zone for example.com.

    To be honest, I can't say for sure if the first line:

    Code:
    @	86400	IN	SOA	ns1.example.com.	dns.example.com.	
    should contain ns1.example.com. instead of example.com, however it works for me and so I guess it should be like that.
     
  10. mike73

    mike73 Member

    Joined:
    May 4, 2006
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    Webignition, I love you, man!

    I'm going to try it out right after work.
     
  11. mike73

    mike73 Member

    Joined:
    May 4, 2006
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    I'm sorry to report, it still isn't working.
     
    #11 mike73, May 10, 2006
    Last edited: May 12, 2006
  12. mike73

    mike73 Member

    Joined:
    May 4, 2006
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    $50 to the paypal account of anyone who can fix this for me. Seriously.

    If you think you know the answer, post it and I'll try it, or you can PM me for login info and try for yourself.
     
    #12 mike73, May 12, 2006
    Last edited: May 13, 2006
Loading...

Share This Page