I'm sorry for the weird question title, but I don't know how to describe the problem in just a few words. I accept suggestions for new title.
Here is my issue, or actually I am not experienced enough in server administration to understand/solve it myself.
I have a server at IP X
I have a domain mydomain.com
purchased from a hosting company
I want to create DNS server ns1.mydomain.com
I want mydomain.com to use ns1.mydomain.com
DNS server
How I can set ns1.mydomain.com
to use IP X
and it's DNS server to serve DNS requests when I cannot set IP as DNS record for ns1.mydomain.com
in the hosting company control panel.
Should I first use my hosting company's DNS hosting insert A record for mydomain.com
to point to IP X
and then setup subdomain (I guess) ns1.mydomain.com
where I can place my DNS server.
Illustration of the scheme:
Domain mydomain.com
using NS ns1.mydomain.com
points to IP X
But how to set ns1.mydomain.com
to point to IP X
Edit:
The answer
Quote from Alnitak:
You only need glue records when the hostname for your nameserver is part of the same domain as it's trying to serve.
Glue records are published in the parent zone. Hence if the operator of example.com wanted to have nameservers named ns1.example.com and ns2.example.com then the .com domain would need something like:
example.com. IN NS ns1.example.com.
IN NS ns2.example.com.
ns1.example.com. IN A 192.0.2.1
ns2.example.com. IN A 198.51.100.5
(example subnets taken from RFC 5737).
The child zone would usually have the same A records in it (even if only for consistency), but when they're in the child zone they're not technically glue records any more.