How to Properly Setup a DNS Hostname with VPS Linux Server


Recommended Posts

Hello,

Well, I just bought a cheap VPS server. Nothing too fancy for now. Just a little something to launch my portfolio. I also bought a domain name to go with it.

However, I'm a little lost..The VPS has Fedora 19 installed on it. How do I setup Bind? I'm trying to setup the hostname (the ns1.site.com thing), but the tutorials that I try..Well, they don't seem to work. None of the files are where they are suppose to be..I don't know if the tutorials are too old, or if I'm doing something wrong..Bind is installed already..And that's about all I know at the moment. I can't seem to find a good tutorial..Been trying to figure this out for a couple of hours now..Beginning to wonder if I should have gone with a simple web host instead of a VPS..lol

Thanks for any help

Link to comment
Share on other sites

Ns1 and ns2 usually refer to name servers, not host names. 

 

Are you trying to configure the your domain to point to your VPS? You can usually do this at the registar that hosts your domain name. This is where you enter the name servers.

 

Once you do that, you can create DNS entries (hostnames ie test.domain.com) that should work.

 

Not really sure if I've caught the drift of what you're trying to do? Sorry if i haven't.

Link to comment
Share on other sites

Sorry, I did mean name servers..Been at this so long, my mind is starting to fall apart..lol

Ya, I need my domain name to point to the server, but I can't seem to figure out how..how do I make the DNS entries? As far as I can figure out, I need Bind to do that?

Link to comment
Share on other sites

Ok - so whoever hosts your domain name, log into the control panel\dashboard\whatever they call it and find the name servers options. Were you given a set of name servers that should point to your VPS?

 

I've never owned a VPS, but I have owned plenty of shared\dedicated physical servers where CPanel\Parallels something (can't remember name) were installed, where I've had the option to create DNS zones. Create a DNS zone for your domain (domain.com). This then allows you to create subdomains (downloads.domain.com etc) 

 

In theory this means, when someone enters your domain name, requests look at your name servers, then forwards requests to your VPS which can serve it up because it's primary DNS zone for your domain. 

Link to comment
Share on other sites

Not sure at the moment if it is..Too confused at the moment..

Don't know how to get a slave either..

Think I need a long break from this at the moment..Try again tomorrow, mind is too confused, to come back at it when it's a little more focused I think lol

Thanks for the help so far though :)

Link to comment
Share on other sites

Who is your registrar?  They normally provide dns.

 

All nice that you want to setup bind.  But you only have 1 IP and 1 vps - hosting nameservers for a domain require 2 IPs, 2 nameservers that should be on different boxes in different geographic areas on 2 different networks, etc..

 

Thee was recently a thread where the way he had registered the domain through the hosting company the interface provided no way to create nameservers for your domain.

 

So in a nutshell

 

you have domainx.com, lets say you have 2 vps with these IPs

 

vps1 1.2.3.4

vps2 5.6.7.8

 

On your registrar you would create 2 nameservers

 

post-14624-0-44382700-1409739673.png

 

post-14624-0-56158100-1409739737.png

 

The registrar now sends this to the root servers..  So when someone looks up domainx.com they know to go ask 1.2.3.4 or 5.6.7.8 for your records

 

Now on your vps you would setup bind to be authoritative for your domainx.com

 

Here is the thing - who is your vps host?  They more than likely provide nameservers you can use?  So on your registrar you point your domain to those.  Or your registrar more than likely provides dns where you come up with a name and on their interface you put in your host name.

 

So for example on my vps - I just use http://freedns.afraid.org/

 

I picked a domain from them, and created a A record pointed to my vps IP.

post-14624-0-35495100-1409740279.png

 

So there are plenty of ways to get a fqdn pointd towards your IP..  You hosting your own nameservers would be my last choice if I were you - for one you don't have enough IPs - or do you?  And you could use a free service as your secondary.

 

Lets start here - what is your vps host company so we can see what features they provide, and who did you register your domain with so we can see what features they provide.

 

Once we have this info - more than happy to show you how to setup bind.  BTW is that the OS you want to run - doesn't your vps allow you to install your OS of choice? 

 

 

 

Link to comment
Share on other sites

snip

I only have a few minutes before I have to go to work, so don't have time to review your post, but to answer the questions quickly, I have one IP.

Registrar is https://www.sibername.com/

VPS server host is http://media-hosts.com/ (http://www.openvz.ca)

And they have other OS's, I just like Fedora..I'm more familiar with it than some of the others. CentOS, Ubuntu, and a couple others I think.

 

I'll be on later today, with some more time to review your post.

Thanks for the help so far!

Oh, and I asked them in an email, if this helps any.

 

 

Sorry, one more question..What is my name server? I'm trying to setup my domain with my server. I have a domain already, I'm just trying to attach it. I've never done this before, but from what I can gather, I'm suppose to have a nameserver from you, what I attach to my domain? I just can't find out where to get that information. Almost have my site up, just can't figure this out. Do I have to create one?

I also need it pointed to a certain folder within /var/www/

Thanks for any assistance

 

And this is their response

 

On a VPS you would be required to create your own nameserver and run an authoritative DNS server on your VPS.

You would first need to create a DNS hostame with your registrar, for example: NS1.yourdomain.com - and point this to your IP: 199.167.128.57

Then you would need to install BIND or any other DNS server on your VPS and create the proper DNS zone for your domain.

Once that is ready, you can log back in to your registrar and point the domain to the new nameserver that you created previously.

Link to comment
Share on other sites

So from their response they do not provide name services. Curious if they provide reverse for your IP. Mine does - so I can point my IP to my fqdn I create for my host. this is not a requirement unless you for example wanted to send email from the box for your domain. Many major players will block email from an IP without a proper reverse record (PTR)

Here is the thing - 1 IP, while some registrars might allow to only have one ns for your domain - it is VERY VERY BAD practice to do so. You should have 2 at min, so if you wanted to host the nameservers for your domain I would suggest we can setup your box as ns1, but will need to find a service that can be your 2nd (ns2) - many free places to do that.

From looking at your host support http://sibername.biz/tutorial/how-to-point-my-domain-to-weebly-com/

They seem to support advanced dns - where you can create records for your domain using their NS - and then just create A records, etc. pointing to your IP.

If you want - if you let me gain access to your account on your registrar we can look through the screens together using teamviewer or something, etc. And we can get your vps with a name in your domain to resolve to its IP.

So in the end what is your goal - do you just want to be able to go to something.yourdomain.tld and get to your vps be it for ssh, ftp, www, etc. Or do you really want to play with running your own nameservices with bind?

Happy to walk you through whatever you want to do - but to be honest, I would go with just getting your registrars dns to resolve your domain to your vps IP. This is by far a much simpler and less complex setup.

Link to comment
Share on other sites

Seems that I made a mistake in buying that host then..Should have gone with something simpler..lol I just wanted a vps to have more control and get some more practice with Linux..

My goal is just to use the host for my site. Nothing fancy, just to launch my portfolio, a typical site..(With ftp access, which is already setup). I have two other sites to launch shortly, but not sure what I'm going to do with those..

Think I'll take you up on that offer too. I'll send you a PM. And simple and less complex sounds good to me! Just want to launch my portfolio...lol

Thanks for this help :)

Link to comment
Share on other sites

I answered your PM - sure we can find a few minutes here soon.  Shouldn't take more than a couple of minutes to be honest.

Link to comment
Share on other sites

This topic is now closed to further replies.