Relationships between Hostname et al.

mike73

Member
May 4, 2006
16
0
151
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!"
 

mike73

Member
May 4, 2006
16
0
151
webignition said:
Can you clarify what you mean by this? You might have missed something important there!
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.
 

mike73

Member
May 4, 2006
16
0
151
btw, my Main Shared Virtual Host IP is the same as ns1.mydomain.com. Is that OK?
 

webignition

Well-Known Member
Jan 22, 2005
1,876
2
166
mike73 said:
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.
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?
 

mike73

Member
May 4, 2006
16
0
151
webignition said:
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?
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.
 

webignition

Well-Known Member
Jan 22, 2005
1,876
2
166
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).
 

mike73

Member
May 4, 2006
16
0
151
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?
 
Last edited:

webignition

Well-Known Member
Jan 22, 2005
1,876
2
166
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.
 

mike73

Member
May 4, 2006
16
0
151
$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.
 
Last edited: