Monday, November 22, 2004

Going further with the DNS installation

Windows Installation

The windows installation is pretty simple.

For one reason or another you insist to run BIND on windows. Well that's perfectly acceptable! Download the BIND executeable linked from the previous post and install it to the default directory.

Under Windows XP, %WINDIR% is 'C:\WINDOWS'
Under Windows NT/2K/2K3, %WINDIR% is 'C:\WINNT'

%WINDIR%\SYSTEM32\dns\bin


In this directory you have all of the BIND executeables. Here's a description of the executeables I'm going to bother mentioning:

named.exe - This is the BIND server program
rndc.exe - This program can be used to manage the server
named-checkzone.exe - This program can be used to check the syntax for zone files
named-checkconf.exe - This program can be used to check the syntax for config files

%WINDIR%\SYSTEM32\dns\etc


In this directory you have all the configuration files and zone files.

Starting and stoping the server under WIndows

start the server

Windows: Control Panel->Administrative Tools->Services->ISC BIND->Start


stop the server

Windows: Control Panel->Administrative Tools->Services->ISC BIND->Stop
DOS: %WINDIR%\SYSTEM32\dns\bin>rndc.exe stop


reload config

Windows: Control Panel->Administrative Tools->Services->ISC BIND->Restart
DOS: %WINDIR%\SYSTEM32\dns\bin>rndc.exe reload


If you try to start the server and it says the application terminated unexpectedly or something, check the error logs like this:

Windows: Control Panel->Administrative Tools->Event Viewer->Application Log
DOS: %WINDIR%\SYSTEM32\dns\bin>named.exe -g


If you did fail to start the server, it means named.conf has a syntax error someplace. Either try to figure it out yourself, or show me the logs using the DOS method.

What i have encountered in WIndows is problem in starting it with the user ID named so i started it under my id and i have admin priv so it works fine for me. :)

The best way to check is
c:\windows\SYSTEM32\dns\bin>named.exe -g
since i use Windows XP.


Linux Installation

Under Linux it is always advisable to run under the chroot shell .

you mebe a Linux Geek or a Linux newbie but it is a great initiaive to install bind under linux. More likely your Linux distro would have bind installed or you can just grab an RPM to install it or what ever method you prefer.The idea is to get a stable release and then a proper config of the named.conf file.

You can download it from here or here


The most likely case is that you have the BIND package installed and likely location for the files is :

Most likely location for the BIND files:

/usr/bin/named - BIND server process
/usr/bin/rndc - BIND management tool
/var/named/ - Location of zone files
/etc/named.conf - BIND configuration file

Even if those aren't the right locations, you can find a file by entering the following commands:
updatedb - update the locate database
locate rndc - example to look for a file
or find / -name rdnc -print (it will take a little more time if you don't wanna do an updatedb)

To start named you enter the following command:

named -u named


The "-u named" part makes sure it is running as the "named" user cause if you started it as root, you'd be in serious trouble if a exploit was discovered for your version of bind. Oh btw, don't know what version you're running? Do the following command:

dig @127.0.0.1 version.bind txt ch


Yep, the whole world can ask your server what version of BIND it is. You can change that, but changing the displayed version is not covered by this basic tutorial. You can always ask me how though. To test to see if named is successfully running you can also do the above command. It'll say there was a timout or something.

If BIND didn't successfully start, you can always do the following command to see what's up:

named -u named -g


Basically you're starting BIND in the console. It will either shut down due to errors, or you have to press CTRL+C to terminate it. Fix any errors you see

Want BIND to start with your system? Well, it's probably already doing so, but you can check to make sure in the following file. This is accurate on redhat 9.0. It may be different on your system:

vi /etc/rc.d/init.d/named
vi /etc/sysconfig/named

You have to get init to start if for you so do it through /etc/rc.d/rc file also.

I am tired now and have a lot of work after some time so will soon be porting more after some time.

Nitin

0 Comments:

Post a Comment

<< Home