hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Web Hosting Talk Tutorials : Hosting Security and Technology Tutorials : A Beginner's Guide to Name Servers Part-1 (Setting up nameservers in WHM/Cpanel)
Reply

Forum Jump

A Beginner's Guide to Name Servers Part-1 (Setting up nameservers in WHM/Cpanel)

Reply Post New Thread In Hosting Security and Technology Tutorials Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old
Junior Guru Wannabe
 
Join Date: Mar 2004
Posts: 42

A Beginner's Guide to Name Servers Part-1 (Setting up nameservers in WHM/Cpanel)


A Beginner's Guide to Name Servers Part-1 (Setting up nameservers in WHM/Cpanel)


Setting up nameservers in WHM/Cpanel

1. Log into WHM

2. Goto Server Setup =>> Edit Setup

Make sure your primary IP is correct under Main Shared Virtual Host IP

Make sure your Hostname is correct under Hostname (server1.xyz.com)

Under Primary Nameserver enter your primary nameserver (ns1.xyz.com), click on Assign Ip Address, then click on Add A entry for this nameserver

Under Secondary Nameserver enter your secondary nameserver (ns2.xyz.com), click on Assign Ip Address, then click on Add A entry for this nameserver

Note: You can add a third and fourth name server if you wish, however this is not necessary. All name servers will be automatically assigned to any accounts you setup later. You will have to manually disable extra nameservers from each account.

Scroll to the bottom and click Save.


Goto DNS Functions =>> Edit a DNS Zone

Choose the primary domain for the server and click Edit

The beginning of your Zone File should look something like this:


-------------------------------------------

; Zone File for ip-2-ip.net


$TTL 14400


@ 14440 IN SOA ns1.xyz.com. admin.xyz.com

-------------------------------------------


In SOA add your primary ns (ns1.xyz.com.) and contact email (admin.xyz.com.). Put a period at the end of your nameserver, and use a period in place of @ in your contact email and add a period at the end too.)


In most cases you should have the following Record Types:

-------------------------------------------

xyz.com. 14440 IN NS ns1.xyz.com.

xyz.com. 14440 IN NS ns2.xyz.com.

xyz.com. 14440 IN A 123.123.123.12 (primary IP Address)

localhost.xyz.com. 14440 IN A 127.0.0.1

xyz.com. 14440 IN MX 0 xyz.com.

mail 14440 IN CNAME xyz.com.

www 14440 IN CNAME xyz.com.

ftp 14440 IN A 123.123.123.13

ns1 14440 IN A 123.123.123.12

ns2 14440 IN A 123.123.123.13

server1 14440 IN A 123.123.123.12 (primary IP Address)

-------------------------------------------


If you do not have A records for your Nameservers add them now. If you use Managed DNS for your domain name, also add A records to your domain name with your DNS.

If you made changes to your zone file, scroll down to the bottom and click on Save


Goto DNS Functions =>> Perform a DNS Cleanup


Now log out of WHM and SSH to your server and login as root.

Note: You can download Putty by Clicking Here. It's a clean running application that will not require installation on Windows-boxes.

Once logged in...

At command prompt type: pico /etc/nameserverips

Make sure all of your nameservers are listed

123.123.123.12=ns1.xyz.com
123.123.123.13=ns2.xyz.com
123.123.123.14=0
123.123.123.15=0
123.123.123.16=0

Remove any nameservers that do not belong.

If you make changes to the file, then press the following keys on your keyboard Ctrl o and then Enter to save the file, then Ctrl x to exit.


At command prompt type: pico /etc/resolv.conf

There should only be three records in the resolv.conf file... localhost, primary nameserver, secondary nameserver.

nameserver 127.0.0.1
nameserver 123.123.123.12
nameserver 123.123.123.13

Remove anything else and then save and exit.


At the prompt type: pico /etc/wwwacct.conf

Make sure all of the information is correct. Remove anything that does not belong, save, then exit.

ADDR 123.123.123.12
CONTACTEMAIL admin@xyz.com
CONTACTPAGER
DEFMOD x
ETHDEV
FTPTYPE proftpd
HOMEDIR /home
HOMEMATCH home
HOST server1.xyz.com
LOGSTYLE combined
MINUID
NS ns1.xyz.com
NS2 ns2.xyz.com
ns3
SCRIPTALIAS y
ns4



At the prompt type: pico /etc/named.conf

Scroll down to the bottom of the file to the zone records.

-------------------------------------------

zone "xyz.com" {
type master;
file "/var/named/xyz.com.db";
};

-------------------------------------------

Make sure all domain zone records are correct. Remove any zone records that are old or do not belong there. If you make any changes, save and then exit.


At the prompt type: [B]pico /etc/host.conf[B]

This file should look like this:

order hosts,bind


At the prompt type: pico /etc/host

This file should look like this:

-------------------------------------------

# Do not remove the following line, or various programs
# that require network functionality will fail.
123.123.123.12 server1.xyz.com server1
127.0.0.1 localhost

-------------------------------------------


Now your done and your nameservers will work like a pro.



Sponsored Links
  #2  
Old
New Member
 
Join Date: Oct 2004
Posts: 4
I hafve been looking for a tut like this thanks.

  #3  
Old
Junior Guru Wannabe
 
Join Date: Mar 2004
Posts: 42
Thank you Webdiscussion.net. By the way, you have a pretty nice forum going on over there at your website.

Sponsored Links
  #4  
Old
Junior Guru
 
Join Date: Sep 2004
Location: Somewhere I belong
Posts: 206
Hi there,

I did like you said here but my name servers at whois.sc are still dns1.name-services.com.. My domain is thitsar.com. What's wrong?

  #5  
Old
Junior Guru Wannabe
 
Join Date: Mar 2004
Posts: 42
Dark_Coder

Those look like Namecheaps Managed nameservers, which is good. In this case, the nameservers for your domain are seperate from the nameservers on your host server. You should be fine.

You still have to point your domain A record to your server and create a separate zone file for your domain on your server. I recommend sticking with Managed DNS, webhostingtalk.com...id=327467, this will have no effect on your server setup.

By the way, I don't know ThePlanets policy, but you might ask them to register the Reverse IP record for your primary IP in your server's name.

  #6  
Old
Junior Guru
 
Join Date: Sep 2004
Location: Somewhere I belong
Posts: 206
oops... My default config in wwwacct.conf is like this

ADDR 67.19.217.20
CONTACTEMAIL kyaw.tayzar@gmail.com
CONTACTPAGER
DEFMOD bluelagoon
ETHDEV
FTPTYPE proftpd
HOMEDIR /home
HOMEMATCH home
HOST gravity.thitsar.com
LOGSTYLE combined
MINUID
NS ns1.thitsar.com
NS2 ns2.thitsar.com
NS3
SCRIPTALIAS y
ns4

but I played with it last night & change the addr to 67.19.217.18, which is another IP of my server. Then I couldn't access to any domains at the server as it said unable to resolve the IP address for that domain but still could enter into WHM & cPanel & ssh via IP addresses..

So I changed back just now to .20.. Why does it happen?

  #7  
Old
Junior Guru
 
Join Date: Sep 2004
Location: Somewhere I belong
Posts: 206
in my resolv.conf file.. there are only three entries for localhost, ns1 & ns2

should I change it to

domain thitsar.com
nameserver 127.0.0.1
nameserver 67.19.217.20
nameserver 67.19.217.19

???

  #8  
Old
Junior Guru Wannabe
 
Join Date: Mar 2004
Posts: 42
Quote:
ADDR 67.19.217.20
CONTACTEMAIL kyaw.tayzar@gmail.com
CONTACTPAGER
DEFMOD bluelagoon
ETHDEV
FTPTYPE proftpd
HOMEDIR /home
HOMEMATCH home
HOST gravity.thitsar.com
LOGSTYLE combined
MINUID
NS ns1.thitsar.com
NS2 ns2.thitsar.com
NS3
SCRIPTALIAS y
ns4
Dark_Coder
Your wwwacct.conf looks ok. It indicates that 67.19.217.20 is your primary IP Address, that gravity.thitsar.com is the server name, and that you have two name servers ns1.thitsar.com and ns2.thitsar.com setup.

You need to get the IP addresses assigned to ns1.thitsar.com and ns2.thitsar.com and make sure they are the same IP addresses that you have listed for your nameservers at Namecheap (or whatever domain name registry you are using).

Although you use Managed DNS and changes that you make to your domain records are propagated immediately, your registered nameservers will still take 24-48 hours to propagate.

By the way, you should bind SSH to only one IP address as a security precaution webhostingtalk.com...threadid=327478.


Quote:
in my resolv.conf file.. there are only three entries for localhost, ns1 & ns2

should I change it to

domain thitsar.com
nameserver 127.0.0.1
nameserver 67.19.217.20
nameserver 67.19.217.19
If the IP assigned to your primary nameserver is 67.19.217.20, and the IP assigned to your secondary name server is 67.19.217.19... then your resolv.conf file should look like this:

Code:
nameserver 127.0.0.1
nameserver 123.123.123.12
nameserver 123.123.123.13
Dark_Coder, I hope this helps you. If you are still having problems, PM me and I'll give you a hand.

  #9  
Old
Junior Guru
 
Join Date: Sep 2004
Location: Somewhere I belong
Posts: 206
Thanks 000000000

Your help works out .. I really appreicate your kind help..

Regards,
Samuel

  #10  
Old
WHT Addict
 
Join Date: Mar 2003
Posts: 128
0000000000
Can you explain what each of these files do and why these files are necessary.

nameserverips
wwwacct.conf
named.conf

Thank you.

  #11  
Old
Web Hosting Evangelist
 
Join Date: Apr 2004
Posts: 476
This is a great tutorial, whoever I get this message through whm

Main >> Server Setup >> Edit Setup
Sorry, you are out of ips to assign as nameservers

I bought an ezzi account and i think i had multiple Ip's included with the package

  #12  
Old
Web Hosting Evangelist
 
Join Date: Apr 2004
Posts: 476
sorry, didnt know that you have to manually add the ip addresses aswell

  #13  
Old
Junior Guru Wannabe
 
Join Date: Mar 2004
Posts: 42
Blueheaven

Hmmm, sorry I didn't think of that when I wrote the post. Every CPanel dedi I leased was already setup. It just never occured to me to add that.

  #14  
Old
Web Hosting Evangelist
 
Join Date: Apr 2004
Posts: 476
I read the guide wrong, and I accidently edited the nameservers instead of the actual domain, so in general what record types should I have for
NS1 and NS2

I also get this message when editing the Domains sometimes
Quote:
dns_master_load: /var/named/ns1.xyz.com.db.test:19: ignoring out-of-zone data (xyz.com)
zone ns1.xyz.com/IN: loaded serial 2---1--1
OK

Bind reloading on admin using rndc zone: [ns1.xyz.com]
Error reloading bind on admin rook: rndc: connect failed: connection refused

Zone Modified!
admin is the name of my subdomain that i used for the account

also how long do the settings take to come into effect, once you have cleaned up and restarted the service

  #15  
Old
Junior Guru Wannabe
 
Join Date: Mar 2004
Posts: 42
Quote:
Security Warning, your resolver configuration contains 127.0.0.1 (localhost). For security reasons, we recommend that you use a non-local dns resolver. Click here to change your configuration.

I forgot to update the thread in this forum. So I'll do it now.

Due to some recent exploit, CPanel has issued this Resolver warning. Just remove the line that says: nameserver 127.0.0.1 from /etc/resolv.conf

At command prompt type: pico /etc/resolv.conf

There should only be two records in the resolv.conf file... primary nameserver, secondary nameserver.

nameserver 123.123.123.12
nameserver 123.123.123.13

Remove 127.0.0.1 and anything else and then save and exit.

Reply

Related posts from TheWhir.com
Title Type Date Posted
Hulk Hogan's Hostamania Announces Partnership with cPanel Web Hosting News 2013-12-10 12:12:09
GoDaddy Supports cPanel as Part of Web Hosting Updates Web Hosting News 2014-05-09 12:40:20
Web Hosting Sales and Promos Roundup - September 20, 2013 Web Hosting News 2014-05-23 15:42:47
TrendyTools Launches HTML 5 Website Builder cPanel Plugin Web Hosting News 2013-08-07 14:18:20
MidPhase Launches Line of Managed Cloud Servers Web Hosting News 2013-05-15 13:47:19


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
WHT Host Brief Email:

We respect your privacy. We will never sell, rent, or give away your address to any outside party, ever.

Advertisement:
Web Hosting News:
WHT Membership
WHT Membership



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?