السلام عليكم
احد جرب هذي الطريقة منقولة للفائدة
========
Hi,
There doesn't yet seem to be a definitive "How To" for setting up your own nameservers on CPanel, so I thought I'd start one by logging here what we did (and we're new to CPanel).
I'd be grateful for your input as we can perhaps then make this into a definitive HOW-TO (there seem to be hundreds of disparate threads on this at the moment).
--------------
Setting up your own nameservers can be a nightmare. It never seems that no two hosts do the same things to get them set up. Anyway, this is what we did.
1. Register Nameservers
Register the domain you're going to use for your nameservers, then register ns1.newdomain.com and ns2.newdomain.com as nameservers (registries normally have a special facility for doing that). The registry may also have a facility to propogate these nameservers around the foreign registries - if so, you should use this facility.
These registrations may take a few days to propagate (often as many as 3 days).
2. Additional IP Addresses
Get an additional IP address. We used the main IP for the server as one name server IP and got an additional IP address to be used for the second name server.
3. Reverse DNS
You may also need to get your data centre to enter a reverse DNS pointer for your nameservers. You'll need to let them know each nameserver and its IP address. Sometimes you can suffer non-delivery of mail if you don't so this. Reverse DNS pointers can take a while to propagate.
4. Broken NDC/BIND
My version of WHM/CPanel came with a broken NDC. To fix this:
SSH into your box as root.
(a) Type: cd /scripts
(b) Type: ./updatenow
(c) Type: ./fixndc
Go back into WHM, go to the Restart Services section in the left menu and click DNS/Nameserver (BIND).
You will need to do this if you start getting 'ndc' errors when you are doing anything DNS related in WHM.
5. Setup Nameservers In WHM
Go into WHM (Web Host Manager) and select Edit Setup from the Server Setup menu on the left. Enter ns1.newdomain.com in the Primary Nameserver field. Hit 'Assign IP Address', then hit 'Add an A Entry for this nameserver'.
Repeat this process for the Secondary Nameserver field.
6. Tidy Up Junk Nameservers
Go into WHM (Web Host Manager) and select Manage Nameserver IPs from the Server Setup menu on the left. Remove any nameservers you don't recognise. This is just a tidy up exercise in case anyone's set anything up on the box before you.
7. Initial Nameserver Setup
Go into WHM (Web Host Manager) and select Initial NameServer Setup from the Server Setup menu on the left. Run this.
8. Restart BIND
Restart BIND (step 7 restarts BIND, but we've known it to need a proper stop and start for it to work) from SSH with:
service named stop
service named start
9. Manual Checks
I don't know what it is about this process, but it doesn't always work, so there are some things you can check manually via SSH.
/etc/wwwacct.conf
Check that the nameservers are correctly specified on NS, NS2 etc.
/etc/resolv.conf
Check that there are nameserver entries for each IP. There may also be one for 127.0.0.1 - this is okay. I'm led to believe (by the 'man' entry for resolv.conf) that this isn't a particularly important file, but I changed mine to read:
domain mybox.com
search mybox.com
nameserver 127.0.0.1
nameserver 111.111.111.111
nameserver 222.222.222.222
Where 'mybox.com' is the main domain of my server, and '111.111.111.111' and '222.222.222.222' are the IP addresses of my primary and secondary nameservers.
resolv.conf is used to lookup names that are not in FQDN format.
/etc/nameserverips
Check that there are entries for each IP acting as a nameserver.