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.
Related
Let's say I have two DNS servers
DNS Server 1 (dnsserver1.com)
test.mydomain.com NS dnsserver2.com
hello.test.mydomain.com CNAME www.apple.com
DNS Server 2 (dnsserver2.com)
hello.test.mydomain.com CNAME www.google.com
According to my tests, if you visit hello.test.mydomain.com it'll display google.com, but I'm wondering if there's a way to override the delegation. Reason for this being that I'm switching my second DNS server (dnsserver2.com -> dnsserver3.com) and I would like to test this new delegation by individually overriding entries before I swap over the entire delegation.
I think I found my answer here, specifically:
Also note that any local zones you create would step on and override any outside DNS server's zones: It's not possible to have the A record for pc.home.mydomain.tld come from one NS and the AAAA record for it come from another: DNS delegates and declares authority by zone name, and that authority is for all record types within that zone.
If a nameserver is told it is authoritative for something and can't find the record it will not forward the query up the DNS tree, it will simply return NXDOMAIN.
As a result, my plan is to delegate individual records a second time like so:
DNS Server 1 (dnsserver1.com)
test.mydomain.com NS dnsserver2.com
DNS Server 2 (dnsserver2.com)
hello.test.mydomain.com NS dnsserver3.com
DNS Server 3 (dnsserver3.com)
hello.test.mydomain.com CNAME www.apple.com
The following is more theoretical than practical, I want to test if I have understood the DNS system.
I'm currently renting a domain, lets call it example.com, from a provider.
I also own a server with a static ip.
Using the webinterface of my domain provider, I created an A-Record for my domain to point to my server.
Now everyone pinging example.com will find that A-Record (that should distribute itself to serveral more DNS servers) and thus ping my server.
Now I want a subdomain, which points to a different ip address.
My provider on the other hand won't let me create subdomains.
I can simply host an own DNS server at example.com, where I can add (arbitraryly) many records for any domain that is a subdomain to example.com (so not only subdomain.example.com but also subdomain.subdomain.example.com).
Now, if someone pings subdomain.example.com the following will happen:
They go to their favourite DNS server, which has an entry for example.com by now (due to distribution, see above)
Since there is no entry for subdomain.example.com, the will send an DNS request on udp port 53 to the A-Record ip behind example.com (my server)
My server will reply with the correct ip of subdomain.example.com
They send their ping to the correct ip
Is my understanding correct?
It's not far off, but there are more subtle things under the hood. If you want to host your example.com zone yourself, then you need to have your parent (.com) have NS records that point to your nameserver on your static IP. You would need to register that within your parent through your registrar that you bought the DNS registration with.
.com would need to host:
example.com. NS myns.example.com
myns.example.com. A YOURIP
And in your zone running on your machine, you would need something like:
example.com. SOA ....
example.com. NS myns.example.com
myns.example.com. A YOURIP
subdomain.example.com A SUBDOMINIP
If "subdomain" (your wording) is actually supposed to be in another zone enirely, then you need to use NS/A records to point to its DNS server (which can be the same).
You might go look for a good tutorial about how the DNS works in general. It will take you a lot further.
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.
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.
My client have a dedicated server on liquedweb cloud service and we my web app is hosted on that server. We want our users to map their domain to our server. So they can enjoy our web app by using their domain name. What information I need to provide to my user so he can map domain and what information I need from them?
I don't know much(in fact anything) about domain mapping
thanks
It depends if the server has a dedicated IP address or is natted.
If the server has a dedicated IP address you can ask your clients to point their entire domain to you server by adding the following A records:
Host TTL Protocol Type IP Address
# 300 IN A 1.1.1.1
www 300 IN A 1.1.1.1
Not all domain hosts ask for TTL,if not dont worry about it.
If you want just their subdomain to point to your server (subdomain.website.com)
subdomain IN A 0.0.0.1
TTL is optional in some systems, in this case the default will be used.
Generally it is recommended that you use an IP for the Apex record and not a domain name. EG: example.com is the apex, www.example.com is the www subdomain.
A typical configuration would be below:
Host TTL Protocol Type Result
# 300 IN A 1.1.1.1
www 300 IN CNAME example.com
This is the same config as the top example but using CNAME example.com. It is the same as using A 1.1.1.1, it just means you only need to change one record.
If your server details are a hostname and not an IP address, most systems will not let you use the hostname for the apex so you will need to find out the IP address. (A simple method is to use the nslookup command or dig command).
TTL is how long in seconds a record last before it expires. If you are unsure what you are doing I recommend lowering this so you can correct mistakes more quickly.
Different methods for the different servers. For most of the servers, you have to change the nameservers of your domain.
This mostly needs when your domain registrar and hosting provider both are different.
First Login into your hosting account, navigate to the account details,
then copy the nameservers from there...which would be like :- dns1.hostingprovider.com
dns2.hostingprovider.com
After that, Go to control panel of your domain. Navigate to the nameservers
You will see the link:- dns1.domainregistrar.com
dns2.domainregistrar.com
Paste the above links at the place of below links.
They need the IP address (and possibly instructions on how to configure their DNS servers (which means a variety of different sets of instructions for different servers and control panels)).
You need the domain name.