So I want to have my own nameservers, like ns1.mydomain.com and ns2 and I have the following things:
- my domain (with godaddy)
- a VPS with 1 IP
- a DNS shared service with access to cPanel and ns1.hostingcompany.com and ns2.hostingcompany.com
So, it's possible to use their shared DNS service and get my own nameservers?
Depending on the VPS hosting company, you can install and run your own nameserver on your VPS and have your nameserver like
ns.mydomain.com
. If you use the shared DNS, you will have to use thens1.hostingcompany.com
nameservers.Your VPS hosting company may act as your secondary DNS servers, but for a small domain it may be just as well to use your domain registrar. This can make lookups a little faster for those servers that need to look up you address.
There's a reason why at least 2 nameservers are required. Don't put both name servers on the same machine.
If you want to run your own DNS servers, set up another cheap VPS somewhere. It doesn't require a lot of resources. However, you'll need to learn about BIND.
create your both name server under 1 ip. Install bind on your VPS server. Configure Bind server and use your own Name server under your VPS server.
Use your VPS as primary for your DNS, then use a DNS replication service as secondary. This is simple and gives best reliability.
For your VPS: install and configure a DNS software. BIND is popular. djbdns is good.
As DNS replication (aka secondary DNS) service, there are several for free:
Find more services at this list of secondary DNS services page.