[b:1e14d313f5]Step by Step instructions on
How to setup Name Servers (Bind Server)[/b:1e14d313f5]
The purpose of this howto is getting your DNS server in Cpanel to work by considering Cpanel 5 new features.
[b:1e14d313f5]Requirements:[/b:1e14d313f5]
You need a registered domain, which we call domain.com here in this how-to
And Cpanel powered Server
[b:1e14d313f5]Definitions of this How to: [/b:1e14d313f5]
In this how-to
When you see this “ root@host # “ it means that you have to enter that command in a root SSH session
Replace host.serverdomain.com and any IP address with your own.
[b:1e14d313f5]Setting up your server:[/b:1e14d313f5]
[b:1e14d313f5]1)/etc/hosts[/b:1e14d313f5]
[b:1e14d313f5]root@host #[/b:1e14d313f5] pico /etc/hosts
Replace 10.20.30.40 with your main-server-IP address
[quote:1e14d313f5]
# Do not remove the following line, or various programs
# that require network functionality will fail.
10.20.30.40 host.serverdomain.com host
127.0.0.1 localhost
[/quote:1e14d313f5]
[b:1e14d313f5]2)/etc/resolv.conf[/b:1e14d313f5]
[b:1e14d313f5]root@host #[/b:1e14d313f5] pico /etc/resolv.conf
In /etc/resolv.conf only the first three IPs (nameserver directives) will be used
Add nameserver 127.0.0.1 and replace other nameservers with your outsource name servers.
[quote:1e14d313f5]
domain domain.com
search domain.com
nameserver 127.0.0.1
nameserver outsource-nameserver-1-(IP address)
nameserver outsource-nameserver-2-(IP address)
[/quote:1e14d313f5]
[b:1e14d313f5]3)in WHM -& Server Setup -& Initial Nameserver Setup[/b:1e14d313f5]
[b:1e14d313f5]4) Setting up your DNS records[/b:1e14d313f5]
[b:1e14d313f5]4-1) add ns1 and ns2 to your Zone database[/b:1e14d313f5]
in WHM -& DNS Functions -& Edit a DNS Zone
Depends on your policies you have a domain.com there, either by adding an account for domain.com or manually adding a DNS zone
Add these records in your domain.com zone database:
(Replace 10.20.30.41 and 10.20.30.42 with your nameserver IPs)
ns1 14400 IN A 10.20.30.41
ns2 14400 IN A 10.20.30.42
[b:1e14d313f5]4-2) setup ns1 and ns2 within your Domain Registrar Database[/b:1e14d313f5]
You should have ns1.domain.com and ns2.domain.com configured correctly within your Registrar database also you need to pass propagation period (approximately 5 days) then your domain is accessible by anyone on the Internet.
[b:1e14d313f5]4-3) in WHM -& Server Setup -& Manage Assigned Nameserver IPs[/b:1e14d313f5]
For updating Cpanel databases It is using 3 things to build its database.
1. DNS lookups
2. WHM history information
3. whois on the ip in question
[b:1e14d313f5]5) Testing your configurations[/b:1e14d313f5]
[b:1e14d313f5]root@host #[/b:1e14d313f5] dig @127.0.0.1 host.domain.com
You should see your DNS record.
From outside of your server:
[b:1e14d313f5]root@host #[/b:1e14d313f5] dig @your-nameserver-ip host.domain.com
or try http://www.dnsreport.com
[b:1e14d313f5]6) Trouble shooting:[/b:1e14d313f5]
[b:1e14d313f5]Q. My DNS works on my server but does not from outside?[/b:1e14d313f5]
Make sure you have passed the propagation period and followed above instructions.
If
[b:1e14d313f5]root@host #[/b:1e14d313f5] dig @127.0.0.1 host.domain.com
works on your server but when your try from outside of your server and you will get connection timed out or name servers are unreachable:
The major possible issue is an incorrect firewall setting check your firewall you can stop it and check if your nameservers are accessible from outside of your server.
Usually this is an issue about IPchains because during server installation in Red Hat you selected firewall without going in details of its settings
Just stop IPchains by using this command in a root SSH session:
[b:1e14d313f5]root@host #[/b:1e14d313f5] /etc/rc.d/init.d/ipchains stop
Then try to access your nameservers from outside of your server as I explained above, it should work
If it works then you know what is the problem; your firewall settings (ipchains in this example)
Also please pay attention to this section in your /etc/named.conf if you haven't you can add this to your /etc/named.conf:
[quote:1e14d313f5]
options {
directory &/var/named&;
/*
* If there is a firewall between you and nameservers you want
* to talk to, you might need to uncomment the query-source
* directive below. Previous versions of BIND always asked
* questions using port 53, but BIND 8.1 uses an unprivileged
* port by default.
*/
// query-source address * port 53;
};
[/quote:1e14d313f5]
[b:1e14d313f5]Q. I got ndc errors?[/b:1e14d313f5]
A. enter this command in a root SSH session
[b:1e14d313f5]root@host #[/b:1e14d313f5] /scripts/fixndc