How to set DA Server to OVH Secondary DNS Server (tutorial)
1. Add your main domain of your DA server to your OVH control panel as below:
OVH panel -> DNS -> Add a secondary DNS
- Fill your "maindomain.com" in related text box "Domain".
- Choose IP that your "maindomain.com" use from dropdown menu.
You will see this message from OVH:
Before continuing, you must add a TXT field in the DNS zone of the domain "maindomain.com", with the sub-domain ownercheck and the following value:xxxxxx
- Go to your DA panel
DNS Administration -> click on your "maindomain.com" -> and add an A record with name of "ownercheck" and value "xxxxxx"
Maindomain is your real domain and xxxxxx is OVH's token that you got in your OVH panel.
- After that click on CONFIRM in your OVH panel. If all is OK you will see your domain in Manage secondary DNS section.
Name of secondary host and related IPv4 and IPv6 are located in the top of page where you added your maindoman.com.
- Go to your domain registrar panel and change your ns2 to OVH's name of secondary host (in my case sdns1.ovh.ca) but it will be different for different users.
- Return back to your DA server panel and edit directadmin.conf (you should have root password)
If you can edit it through SSH then you can use nano or vi command to edit it at:
/usr/local/directadmin/conf/directadmin.conf
add
named_checkzone=0 save and restart directadmin.
- Go to the DA panel -> DNS Administration
Open your "mydomain.com" zone and remove your old ns2.
add your OVH Secondary host dns (sdns1.ovh.ca or something else from your OH panel) to this zone
maindomain.com. NS OVH's SDNS
after that remove ns2.maindomain.com A record and add new
OVH's SDNS(for example: sdns1.ovh.ca) A OVH's SDNS IP(xxx.xxx.xxx.xxx)
- Go to DNS Administration of you DA panel
open server.maindomain.com and remove old ns2 record and add one new record as below:
server.maindomain.com NS OVH's SDNS(for example: sdns1.ovh.ca)
- Through file editor of your DA panel open
named.conf
find your zone "maindomain.com" at the end of file and add this:
allow-transfer { trusted-servers; };
so your zone "maindomain.com" will be like this:
zone "maindomain.com" { type master; file "/var/named/maindomain.com.db"; allow-transfer { trusted-servers; }; };
change maindomain.com to your real domain.
and add this piece of code in named.conf too:
acl trusted-servers {
9.9.9.9; // ns1.mydomain.com
8.33.137.137; // sdns1.ovh.ca
};
change IP's to your main IP that your maindomain.com uses and second to OVH's SDNS IP.
-Restart named.conf from your DA panel "Service monitor" or from SSH.
All done.
Let's test that all is OK with your configuration or not:
Through SSH:
dig @OVH's SDNS maindomain.com
Notice you should wait for DNS propagation after changing DNS in your domain registrar panel. You can check that new DNS set or not via
https://intodns.com
Best regrads,
Milos