Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What I have:

  • 1 Virtual Private Server (Unmanaged Linux VPS)
  • 1 dedicated IP address

Purchased from X hosting Company

  • Few Domain names

Purchased from Y hosting Company

What I Want to do

I need to set the nameserver from my domain names which i have purchased from a different hosting company.

How can i create a set nameserver at my VPS so that i can resolve all the domain names with corresponding IP addresses and Resource Records


Say i have domain names:

i want to create a nameserver like so that i will be able to resolve all the DNS records for my above domain names.

so that i can point each: --> --> -->

I tried usingbind9 and quite comfortable with, the only problem lies with the nameserver i.e.

please help..

share|improve this question
up vote 2 down vote accepted

You install bind9 on your server, which i'll say has the IP address; we'll call it You configure it to be primary for the three zones, and (let's spread the love in the TLDs!). Ensure that you have an SOA record that lists and as authoritative for each domain, and A records for both and pointing to

You test that they're working by

ns1% dig soa @localhost

and likewise for the other two domains. Don't go any further until you've got this bit working.

Change your glue records, that is, the records maintained through your registrar (the organisation you pay for the right to have the domain names,, etc.) so that the listed nameservers for each of the domains are and When doing this for's records, you will have to give the IP addresses of the two nameservers as well, which are This avoids the chicken-and-egg problem where I go to look up, get told that the authoritative servers for are and, so I try to look those up, and get told that the authoritative servers for are and, so I try to look those up, you can see where this is going wrong, yes?

And that should be it. You can check the glue records are right with


and you already know that your nameservers are serving because you checked it with dig above, right? Check it again anyway, preferably from a third box so you don't overlook any firewall-related or i-only-listen-on- issues.

Optional extra: find a friend with a nameserver and have him/her run secondary NS for you. Generally, you need to advertise two NS records for a domain, and while it's possible to list the same one twice, it's bad form. There is a bunch of other stuff you need to do here, making sure that ns1 allows your friend's box to transfer the zone, that your friend's box is configured to look to you as master, that sort of thing). If you do all this, change the A record for to your friend's name server's address in your zone files, and your glue records accordingly.

Enjoy nameservery goodness, and have a well-earned coffee. Does that make sense?

share|improve this answer
@MadHatter, i am too much screwed up with this DNS stuff, if possible can we have a chat on gtalk or IRC? – Idlecool Nov 1 '10 at 9:58
let say i have a domain name, now what should be my VPS host name: or i can keep it anything as i wish? – Idlecool Nov 1 '10 at 10:02
Define hostname. Do you mean "the name that the machine calls itself"? That can be anything you like. All I'm saying above is that the DNS needs to be self-consistent; you need to have an A record for which points to, both the name and the address need to appear in the glue records for, and needs to appear in the SOA record of the zone. – MadHatter Nov 1 '10 at 10:58
I apologise, but I don't have the time to talk you through this on a chat forum. If you can formulate questions here, I'll try to answer them in my spare minutes. DNS is complex - not tricky, but there are a lot of things that all have to be setup right for it all to work - so you need to do your research and take care! – MadHatter Nov 1 '10 at 11:00
@MadHatter thanks for the assistance.. seems it will help me to solve the problem – Idlecool Nov 1 '10 at 11:42

What you are looking for is a vanity DNS and you can find some info here.

share|improve this answer
i dont want to use some service in between, i want to create such service for myself – Idlecool Nov 1 '10 at 7:57
Just saw that you have got an answer. Cheers. – sybreon Nov 2 '10 at 1:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.