Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am still a newbie when it comes to Linux, and I recently bought 2 domains from NameCheap.

Running a LEMP stack on Debian 7 and want to know how I can create name servers like ns1.example.com and ns2.example.com on my server, because that's what I need to set in my domain settings for them to point to my server.

I am using Google's public DNS name resolver 8.8.8.8 and 8.8.4.4 (in my resolv.conf file), if that's of any help.

I have found some lengthy tutorials on YT and elsewhere, but to me they weren't so clear because in every one they are setting up some kind of made up local domain (with Bind9). And haven't found anything that handles setting up name servers and making registered domains point to the server.

If anybody could explain to me how I could achieve this (so that example1.com points to let's say [ip]/site_dir1), or tell me what I need to be searching for to get this done, it would be greatly appreciated.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

There is nothing magical with Bind : to manage your own DNS (that is, on your own server), you will need a DNS server such as Bind which will serve as the Authoritative Name Server for your domain. As far as I'm concerned, I find this video from DNS Made Easy rather good when it comes to explaining how DNS works (except maybe the registrar part which goes far too fast).

In a few steps :

  • Set up bind on your machine.
  • Create bind configuration and zone files for your domain.
  • Configure your domain (through your registrar) to use this server. You may want to have a look here.

Concerning Bind configuration on Debian, you'll find an unbelievable amount of documentation on the web. Starting here, and here, and here, and here... But let's be clear : setting up DNS servers can take some time, especially the first time.

Another component will also be needed if you want to match your domains (and subdomains) to web contents : a web server. You will need to have a look at Apache Virtual Hosts.

Unix & Linux cannot provide you with a full Bind (and Apache) tutorial, that would make your question far too broad. We can give you the big picture, now you need to study all its parts :)

share|improve this answer
    
This is exactly what I needed! –  Kid Diamond Aug 2 at 12:11

Your Answer

 
discard

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.