How to setup DNS to connect 2 servers with 1 Domain? - dns

I have 2 servers with WHM installed. I want to map 2 IPs of each server to 4 Name Servers of my Domain.
Server 1 IPs: 1.2.3.4 & 1.2.3.5
Server 2 IPs: 2.2.3.4 & 2.2.3.5
So my 4 Name Servers should be like:
ns1.example.com 1.2.3.4
ns2.example.com 1.2.3.5
ns3.example.com 2.2.3.4
ns4.example.com 2.2.3.5
From what I understand:
I need to create 4 Child Name Servers at my Domain Registrar and
point them to these 4 IPs.
I need to create same account for my domain on both servers.
On Server 1 I need to add NS1 and NS2 A records to the DNS Zone Entries of my domain cPanel account.
On Server 2 I need to add NS3 and NS4 A records to the DNS Zone Entries of my domain cPanel account.
Then I will just give half my clients NS1 and NS2 and the rest clients NS3 and NS4 to point their domains to.
Can anyone please suggest the points I shared here are sufficient? As I tried these settings for my servers. Sometimes, the DNS doesn't work for a few websites.
Do I need to add NS3 and NS4 entries to the Server 1 and vice versa?
Any help would be much appreciated.
Thanks

You have to have the dns zone files of the same domains on both WHM servers.
On WHM1 server let's say you have NS1 and NS2 and on WHM2 server you have NS3 and NS4
You domain zone file should have entries for all 4 nameservers like:
domain.com. IN NS NS1
domain.com. IN NS NS2
domain.com. IN NS NS3
domain.com. IN NS NS4
The best approach would be to use DNS Clustering. You will need at least one cPanel/WHM server and then one or more cPanel/WHM DNS Only servers. With this setup when a new cPanel account is added, the dns zone files will be synced around the DNS Cluster. The WHM server itself won't be a DNS server but will just send the zone files do you DNS Cluster and their members.
With your actual setup, if you add a cPanel domain on WHM2 server let's say, it's added with the 4 nameservers but the DNS zone file is only created on WHM2 where you have added the cpanel account. You will have then to manually create the dns zone for that domain on WHM1 server in order to have all the DNS servers as functional.

Related

Can I use Multiply Nameservers

I have a domain and the host (Education Host) require to change the nameserver of that domain to its nameservers but the host doesn't have a DNS zone so I want to manage DNS with CloudFlare but its require to change nameservers too. So I want to use both of them but I don't know what happens?
Nothing happens, enter to your Cloudflare panel, change your domains DNS to Cloudflare DNS and in the IP section; Insert IP of your hosts (Education Host).
This will connect your domain to the host, and you can also manage domain records in Cloudfler.
reading this article will help you.

Problem binding hostname to website on IIS

I have a Windows server 2016 with IIS. I've added forward lookup zone on DNS manager and added two Host(A) records for ns1 and ns2. I also added two NameServer as ns1.mydomain1.com and ns2.mydomain1.com.
I have another domain as mydomain2.com and set this dns to ns1.mydomain1.com and ns2.mydomain1.com. If I'm binding site to mydomain1.com it's worked but when binding to mydomain2.com it does not work.
It is mentioned, I have set dns of mydomain1.com to ip of server.

Setting up CNAME and MX DNS records DigitalOcean

I am transfering my domain from network solutions to digitalocean, but want to keep my email server on network solutions. I pointed my DNS server to digitaloceans nameservers, but now I am confused on how to create the MX and CNAME records..
You need to create new zone file for your domain in the DigitalOcean DNS control panel. In the zone file you can add MX and CNAME records pointing to your old network solutions server for emails.

Making nameserver for put domain on server ip

I have a domain and i want to set it to my server(centos 7).
I made a dns server by bind on my server and made 2 nameserver (ns1.myDomain.ir and ns1.myDomain.ir) and set it in my domain configuration, But i cant ping to my domain.
What is the problem?
At the domain registrar, you need to specify the authorised DNS server for your domain. My suggestion is to use the domain registrar's DNS server for resolution and create a zone file there for your domain and enter the A records and other records for your use case.
To have a domain working you don't need to setup your on DNS (bind) server.

Setting up a custom nameserver with BIND9

Lets say that I purchased a new domain (somedomain.com) from a domain registar and I wanted to setup my own nameserver on a server that has two IP addresses.
First I buy the domain.
I get the server.
install BIND9.
I login to the server and prepare the DNS records for NS1.SOMEDOMAIN.COM and NS2.SOMEDOMAIN.COM.
Where do I set these up in BIND and how should I do it?
Next Step:
Go back to the domain registar and set the DNS to point to NS1.SOMEDOMAIN.COM and NS2.SOMEDOMAIN.COM.
Is it a bad thing if the domain that I am forwarding is pointed to its OWN nameserver domain? Should I change this? How does it know where NS1 and NS2 go when both subdomains are apart of the domain that is being forwarded to them?
Should I just use the DNS provided by my registar and make two CNAME record entries for NS1 and NS2 to point to the server ips of the newly created DNS server? Would this work?
Can anyone explain this process to me? Thanks.
Do add the following step which is crucial to using your name servers in the WHOIS record:
Step 5: Go back to your registrar (wherever you bought the domain in step 1) and create the special NameServer records in their administrative control panel; for example, on godaddy.com, you need to go to advanced > hosts and there you can set up ns1 to point to the IP address of your server (step 2).
You will need to do the same for ns2.
This will vary from registrar to registrar, consult their documentation or contact customer support.
Step 6: Update the WHOIS record to reflect your new nameservers.
Where do I set these up in BIND and how should I do it?
You would set these up in the domain's zone record, not unlike this:
yourdomain.com. IN SOA ns1.yourdomain.com. you.yourdomain.com. (
1032789388
10800
3600
604800
300 )
yourdomain.com. IN NS ns1.yourdomain.com.
yourdomain.com. IN NS ns2.yourdomain.com.
ns1.yourdomain.com. IN A xxx.xxx.xxx.xxx
ns2.yourdomain.com. IN A yyy.yyy.yyy.yyy
Is it a bad thing if the domain that I am forwarding is pointed to its OWN nameserver domain? Should I change this?
Running DNS from the same domain is fine.
How does it know where NS1 and NS2 go when both sub-domains are apart of the domain that is being forwarded to them?
See Step 5 above - your registrar handles this bit, registering your name servers and allowing them to participate in the 'net.
Should I just use the DNS provided by my registar and make two CNAME record entries for NS1 and NS2 to point to the server ips of the newly created DNS server? Would this work?
This would not work as you would still need to do Step 5; to be honest, I'm not sure what would happen if you did not serve the DNS for ns1 off of the same host.
Additional note:
While you CAN run one DNS server for both ns1 and ns2, it is not recommended.
Usually you want your secondary (slave) DNS server to be as far away as possible from your primary (master) DNS server... located in a different country is usually the best.
But, there is nothing technically preventing you from using two different IPs on the same physical hardware.

Resources