Irish SEO,  Marketing & Webmaster Discussion
 

 

Go Back   Irish SEO, Marketing & Webmaster Discussion > Webmaster Help > Server / Technical Administration Tips and Queries


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-09-2007, 01:16 AM
Coder
Recent Blog: My new mail setup
 
Join Date: May 2007
Location: Dublin
Posts: 50
ConorP will become famous soon enough
Default Setting up a DNS Server

Part 1 of (god knows how many, I don't know why, but I shouldn't decide to do stuff like this at 1am)

Crappy legal stuff: Copyright moi. Don't even consider holding me liable for anything that happens or doesn't happen by following this guide or anything else which might or might not happen when you are reading this howto.

e.g. If you are so engrossed in this guide and sitting in a chair with wheels when you push back and crush your cat and hear a very loud noise then swivel around to investigate it and in the process knock over a glass of some beverage you were consuming onto a already overloaded power extension and start a small electrical fire which then quickly spreads onto the giant magazine collection you have and sets fire to various other things in your room and eventually leads to the burning down of your house. Don't say I didn't warn you.

Also if you plan on publishing this somewhere else, it would be nice if you gave credit and left the entire article intact. So lets move onto the howto.

Due to multi platform madness I won't go into how to install bind (named) but you would be looking at doing one of the following commands

apt-get install bind9
yum install bind
rpm -ivh bind_package_name.rpm
emerge bind (Taking a stab at gentoo, never used it before)
./configure && make && make install (as root)


Depending on the package you've just installed, you could have a configuration that works mostly out of the box, or no configuration at all. I'll just assume you've got no configuration. You should be able to pick up later on.

Add a user which will not be used for anything else. This is a security thing so if someone does break/crack your DNS server, the damage they can do is limited.

You'll want to make a user now

adduser -h /var/named -s /bin/false named

The -h tells you where you want the home directory and the -s is what shell you want used for this account. We use /bin/false to stop anyone logging in.

And in part 2 we'll look at editing named.conf
Reply With Quote
  #2 (permalink)  
Old 06-09-2007, 08:24 AM
blacknight's Avatar
Web Slave
Recent Blog: Podcamp Ireland 2008
 
Join Date: Jan 2006
Location: Ireland
Posts: 5,897
blacknight is just really niceblacknight is just really niceblacknight is just really niceblacknight is just really nice
Send a message via ICQ to blacknight Send a message via AIM to blacknight Send a message via MSN to blacknight
Default

Thanks for taking the time to start this off
Reply With Quote
  #3 (permalink)  
Old 06-09-2007, 02:53 PM
georgiecasey's Avatar
Member
Recent Blog: Irish torrents site
 
Join Date: Jul 2006
Location: Galway / Ennis
Posts: 277
georgiecasey will become famous soon enough
Send a message via ICQ to georgiecasey
Default

i couldn't get bind working, but djb dns worked great. good guide to install here. DJBDNS Howto - The Planet Forums
__________________

My Blog
Reply With Quote
  #4 (permalink)  
Old 07-09-2007, 02:22 AM
Coder
Recent Blog: My new mail setup
 
Join Date: May 2007
Location: Dublin
Posts: 50
ConorP will become famous soon enough
Default

named.conf - The file which holds it all together.

You'll normally find named.conf to be in /etc so we'll start there

Open up /etc/named.conf in your text editor of choice. (Personally I like nano, I'll use vim where nano isn't available)

We have to define some important things here

We'll set the options for named firstly

Code:
options {
directory "/var/named"; //Tell named where to find everything
allow-transfer { none; }; //Don't let anybody preform a zone transfer 
allow-recursion { localhost; }; //We don't want to be an open dns server
// Use your ISP's or run your own damnit
version "DNS Server"; //Set the version reply, so if anyone is profiling the //network, it makes it harder for them
};
Now you have the basic config for a DNS server but its pretty useless at the moment! It doesn't know where to look for DNS queries or what zones it is serving, we'll tell it where to find other DNS servers

Change directory so you are now in /var/named

We're going to have to download a little file here from the people who run the root dns servers

Run this to download that file:
wget http://www.internic.net/zones/named.root

You should now have a file called named.root in /var/named. Don't worry about keeping this up to date or anything, the last change was made in 2004

Just to be sure set the permissions of that file:

chown named:named named.root

Now head back into editing /etc/named.conf

Add this to the bottom of the configuration (outside of the options bracket)

Code:
zone "." {
type hint;
file "/var/named/named.root";
};
So you should now have a file looking like this

Code:
options {
directory "/var/named"; //Tell named where to find everything
allow-transfer { none; }; //Don't let anybody preform a zone transfer 
allow-recursion { localhost; }; //We don't want to be an open dns server
// Use your ISP's or run your own damnit
version "DNS Server"; //Set the version reply, so if anyone is profiling the //network, it makes it harder for them
};

zone "." {
type hint;
file "/var/named/named.root";
};
Now part 3 will show how to set up named so it serves zones.
Reply With Quote
  #5 (permalink)  
Old 06-10-2007, 01:44 AM
Coder
Recent Blog: My new mail setup
 
Join Date: May 2007
Location: Dublin
Posts: 50
ConorP will become famous soon enough
Default

Ok lets serve some domains

You want to add a section to your named.conf to tell it, that it is authoritative server for your domain

Lets say we want to host irishwebmasterforum.com and our nameserver is ns1.myserver.com (I should explain this bit) and our nice geographically diverse second nameserver (I'm looking at some hosts here ) is ns2.myserver.com

We'd add this to our named.conf

Code:
zone "irishwebmasterforum.com" {
type master;
file "/var/named/irishwebmasterforum.com.db";
};
I know updates have been a little sparse over the last week or two... or three... been busy with job hunting and other stuff.
Reply With Quote
  #6 (permalink)  
Old 20-10-2007, 10:36 PM
Coder
Recent Blog: My new mail setup
 
Join Date: May 2007
Location: Dublin
Posts: 50
ConorP will become famous soon enough
Default

Actually I should clear this up a bit more to avoid confusion.. that I've probably already caused.

The machine we are using *is* ns1.myserver.com

So lets open up the zone file for irishwebmasterforum.com

Quote:
nano /var/named/irishwebmasterforum.com.db
And we should have a nice blank file to work with.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Script Installation, Server Administration bizhat Marketplace Offers 2 10-03-2008 11:29 AM
Setting up a server daviddoran Server / Technical Administration Tips and Queries 4 21-02-2007 02:00 PM
setting up web server tutorials georgiecasey Server / Technical Administration Tips and Queries 3 17-02-2007 06:23 PM
Delete Or Redirect Files From Server? Peter McC Webmaster Discussion 4 14-02-2007 12:32 PM
Server security richardo Webmaster Discussion 0 20-02-2006 05:07 PM


All times are GMT +1. The time now is 12:29 PM.


Powered by: vBulletin Version 3.7.2, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.

Search Engine Friendly URLs by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56