Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 26
  1. #1
    Member
    Join Date
    Sep 2004
    Posts
    21

    Default 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:


    Code:
    ; 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:

    Code:
    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.

    Code:
    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.

  2. #2
    Member This forum account has been confirmed by cPanel staff to represent a vendor. Radio_Head's Avatar
    Join Date
    Feb 2002
    Posts
    2,064

    Default

    I don't have

    pico /etc/host

    is it required ?
    Stop SPAM & VIRUS :: ASSP Deluxe for cPanel http://www.grscripts.com
    █ ASSP Deluxe is supported by Fritz Borgstedt,ASSP main developer.

  3. #3
    Moderator cPanel Partner NOC Badge dgbaker's Avatar
    Join Date
    Sep 2002
    Location
    Toronto, Ontario Canada
    Posts
    2,773

    Default

    It should have read

    pico /etc/hosts <-- note the s

    Just a typo by the looks of it.
    Regards,
    David
    Forum Moderator

  4. #4
    Member This forum account has been confirmed by cPanel staff to represent a vendor. Radio_Head's Avatar
    Join Date
    Feb 2002
    Posts
    2,064

    Default

    Quote Originally Posted by dgbaker
    It should have read

    pico /etc/hosts <-- note the s

    Just a typo by the looks of it.

    Thank you !, I have it .
    Also if I find strange things inside it , for example togheter with
    123.123.123.12 server1.xyz.com server1 I had r-fx r-fx.net (?)

    Just a question ...

    when I modify /etc/hosts and /etc/resolv.conf it's enough a bind restart
    or do I need to restart server ?

    Thank you!
    Stop SPAM & VIRUS :: ASSP Deluxe for cPanel http://www.grscripts.com
    █ ASSP Deluxe is supported by Fritz Borgstedt,ASSP main developer.

  5. #5
    Member sawbuck's Avatar
    Join Date
    Jan 2004
    Posts
    1,313
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by Radio_Head
    when I modify /etc/hosts and /etc/resolv.conf it's enough a bind restart
    or do I need to restart server ?
    /etc/resolv.conf - Bind restart
    /etc/hosts - Server reboot

  6. #6
    Registered User
    Join Date
    Oct 2004
    Posts
    1

    Default

    Hi,

    Everything seems fine in my files except for these two: (they are empty), what should I do?

    pico /etc/named.conf

    pico /etc/host.conf[B]

    Also, when I try to point one of my domains to my hosting using the dns settings that I've setup it says:

    Field Validation Error

    Please correct the following issue(s):

    Unavailable error in field Host name1
    Unavailable error in field Host name2

    Please Help!

    Thanks,

    Walter.

  7. #7
    BANNED
    Join Date
    Feb 2004
    Posts
    349

    Default

    Why would you have

    ns1 14440 IN A 123.123.123.12

    ns2 14440 IN A 123.123.123.13


    In your example? Unless these are subdomains they shouldnt be in the zone file.

  8. #8
    Member sawbuck's Avatar
    Join Date
    Jan 2004
    Posts
    1,313
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Have you tried running /scripts/fixnamed?

  9. #9
    Member
    Join Date
    Nov 2003
    Posts
    521

    Default

    Quote Originally Posted by sawbuck
    Have you tried running /scripts/fixnamed?
    What exactly does the above script do, and is there a chance it might harm or break anything?

  10. #10
    Member
    Join Date
    Sep 2004
    Location
    Roscoe, IL, USA
    Posts
    61

    Default

    With resolv.conf setup as mentioned above I now get a security warning at the top of WebHost Manager:

    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.
    Can someone update this so it will be correct? What is resolv.conf supposed to look like now that it is not supposed to have the localhost address in it?
    Last edited by JP-HOST; 10-23-2004 at 01:44 PM.

  11. #11
    Registered User
    Join Date
    Oct 2004
    Posts
    1

    Default

    I am seeing the same error message:

    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.
    Anyone have suggestions?

    Thanks

  12. #12
    Member
    Join Date
    Sep 2004
    Posts
    21

    Default

    Quote Originally Posted by prepress70
    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.
    This securety issue was released after the initial post. Remove "nameserver 127.0.0.1" from /etc/resolv.conf.

  13. #13
    Member
    Join Date
    Aug 2006
    Posts
    34

    Default

    This guide is just wonderful. Thanks a lot. Where can I find Part 2?

    Thanks.

  14. #14
    Member
    Join Date
    Jun 2003
    Location
    Bharat
    Posts
    232
    cPanel/Enkompass Access Level

    Root Administrator

    Default Zone Template Editor

    Ok what do this Zone Template Editor do, do these Zone Template are the templates to setup new domains on a machine. I am asking this because I just got a new machine where when setting up a new domain every time I have to manually correct its zone otherwise the domain will not show up on the net.

    Following are the zone tempaltes on my new machine:

    Zone Template: simple
    ; cPanel %cpversion%
    ; Zone file for %domain%
    $TTL %ttl%
    @ %nsttl% IN SOA %nameserver%. %rpemail%. (
    %serial% ; serial, todays date+todays
    86400 ; refresh, seconds
    7200 ; retry, seconds
    3600000 ; expire, seconds
    86400 ) ; minimum, seconds

    %domain%. %nsttl% IN NS %nameserver%.
    %domain%. %nsttl% IN NS %nameserver2%.
    %domain%. %nsttl% IN NS %nameserver3%.
    %domain%. %nsttl% IN NS %nameserver4%.

    %nameserverentry%. IN A %nameservera%
    %nameserverentry2%. IN A %nameservera2%
    %nameserverentry3%. IN A %nameservera3%
    %nameserverentry4%. IN A %nameservera4%

    %domain%. IN A %ip%

    localhost.%domain%. IN A 127.0.0.1

    %domain%. IN MX 0 %domain%.

    Zone Template: standard
    ; cPanel %cpversion%
    ; Zone file for %domain%
    $TTL %ttl%
    @ %nsttl% IN SOA %nameserver%. %rpemail%. (
    %serial% ; serial, todays date+todays
    3600 ; refresh, seconds
    3600 ; retry, seconds
    1209600 ; expire, seconds
    43200 ) ; minimum, seconds

    %domain%. %nsttl% IN NS %nameserver%.
    %domain%. %nsttl% IN NS %nameserver2%.
    %domain%. %nsttl% IN NS %nameserver3%.
    %domain%. %nsttl% IN NS %nameserver4%.

    %nameserverentry%. IN A %nameservera%
    %nameserverentry2%. IN A %nameservera2%
    %nameserverentry3%. IN A %nameservera3%
    %nameserverentry4%. IN A %nameservera4%

    %domain%. IN A %ip%

    localhost.%domain%. IN A 127.0.0.1

    %domain%. IN MX 0 %domain%.

    mail IN CNAME %domain%.
    www IN CNAME %domain%.
    ftp IN CNAME %domain%.

    Zone Template: standardvirtualftp
    ; cPanel %cpversion%
    ; Zone file for %domain%
    $TTL %ttl%
    @ %nsttl% IN SOA %nameserver%. %rpemail%. (
    %serial% ; serial, todays date+todays
    86400 ; refresh, seconds
    7200 ; retry, seconds
    3600000 ; expire, seconds
    86400 ) ; minimum, seconds

    %domain%. %nsttl% IN NS %nameserver%.
    %domain%. %nsttl% IN NS %nameserver2%.
    %domain%. %nsttl% IN NS %nameserver3%.
    %domain%. %nsttl% IN NS %nameserver4%.

    %nameserverentry%. IN A %nameservera%
    %nameserverentry2%. IN A %nameservera2%
    %nameserverentry3%. IN A %nameservera3%
    %nameserverentry4%. IN A %nameservera4%

    %domain%. IN A %ip%

    localhost.%domain%. IN A 127.0.0.1

    %domain%. IN MX 0 %domain%.

    mail IN CNAME %domain%.
    www IN CNAME %domain%.
    ftp IN A %ftpip%
    These:
    %nameserverentry%. IN A %nameservera%
    %nameserverentry2%. IN A %nameservera2%
    %nameserverentry3%. IN A %nameservera3%
    %nameserverentry4%. IN A %nameservera4%
    are the entries that I have to clean up from each zone to make a domain visible on the net.

    So can any one here post the correct Zone Templates?

    Thanks in advance.
    Vinayak Sharma
    Vinsar.Net - Quality WebHosting Services at Economical Price USA, UK & Italian Servers
    Book Your Domain with Confidence Reliable Domain Reseller Account

  15. #15
    Member
    Join Date
    Sep 2005
    Location
    Slovakia / Belgium
    Posts
    25

    Angry

    Hi,

    I am sweating blood trying to get my primary domain and its nameservers work... see what dnsreport.com says about fulopp.org (a timeout occurred getting the NS records from your nameservers), it's hopeless! Internally, I can ping all domains, named starts all right, I did a DNS cleanup a million times, no help. I really don't see what's wrong... do you, anybody?

    Strange, it seems I can also ping ns1.fulopp.org and ns2.fulopp.org but I cannot ping fulopp.org directly! Why???

    Vinsar, do you mean I should delete something from the zone to get it to work?

    Here's the zone (I just changed e-mail):

    ; Modified by Web Host Manager
    ; Zone File for fulopp.org
    $TTL 14400
    @ 86400 IN SOA ns1.fulopp.org. my.maildomain.com. ( 2006082210
    86400
    7200
    3600000
    86400
    )

    fulopp.org. 86400 IN NS ns1.fulopp.org.
    fulopp.org. 86400 IN NS ns2.fulopp.org.

    fulopp.org. 14400 IN A 216.237.127.250

    localhost.fulopp.org. 14400 IN A 127.0.0.1

    fulopp.org. 14400 IN MX 0 fulopp.org.

    mail 14400 IN CNAME fulopp.org.
    www 14400 IN CNAME fulopp.org.
    ftp 14400 IN A 216.237.127.250
    ns1 14400 IN A 216.237.127.250
    ns2 14400 IN A 216.237.127.251
    mainframe 14400 IN A 216.237.127.250
    Last edited by tjfulopp; 08-22-2006 at 09:33 AM.

Similar Threads & Tags
Similar threads

  1. A Beginner's Guide to Securing Your Server
    By 000000000 in forum Security
    Replies: 255
    Last Post: 09-14-2011, 10:34 AM
  2. im new at whm so please help setting up nameservers
    By Caos in forum cPanel and WHM Discussions
    Replies: 17
    Last Post: 02-02-2010, 06:07 PM
  3. A Beginner's Guide to Name Servers Part-2 (Custom Nameservers for Resellers)
    By 000000000 in forum cPanel and WHM Discussions
    Replies: 8
    Last Post: 10-29-2008, 01:02 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube