next up previous contents index
Next: Compiling udhcp-0.9.8 Up: Setting up an own Previous: Setting up an own   Contents   Index


Compiling yaku-ns

Even if the author of this source code warns on his homepage [Sanfilippo02] using this code because it's experimental, I've got no problems so far running the nameserver.

First, we need to download the appropriate source package. Because of its "experimental state", there's no official released source package. So, we have to download the complete source via CVS. CVS will ask for a password, just press enter, no password is required:

$ cd ~/Dreamcast/BUILD
$ cvs -d:pserver:anonymous@cvs.hping2.sourceforge.net:\
  /cvsroot/hping2 login
$ cvs -z3 -d:pserver:anonymous@cvs.hping2.sourceforge.net:\
  /cvsroot/hping2 checkout yaku-ns
$ cvs -d:pserver:anonymous@cvs.hping2.sourceforge.net:\
  /cvsroot/hping2 logout
$ cd yak-ns

Now, we may remove the CVS control directories:

$ for i in $(find . -type d -name "CVS" -print); do rm -fr $i; done

Now, we're ready to compile yaku-ns:

$ make CC=$UCLIBC/usr/bin/cc \
  AR=$UCLIBC/usr/bin/ar CFLAGS="-Os -I. -Wall"

Following, we copy the binary to our initial ramdisk:

$ mkdir ../../INITRD/usr/yaku-ns
$ cp yaku-ns ../../INITRD/usr/yaku-ns

Now, we configure the nameserver. First, we have to create a user and group named yaku:

$ cd ../../INITRD
$ cd etc
$ su
# cat <<. >>passwd
yaku:x:99:99::/usr/yaku-ns:/bin/sh
.
# cat <<. >>shadow
yaku:*:12091:0:99999:7:::
.
# cat <<. >>group
yaku:x:99:
.
# cat <<. >>gshadow
yaku:!::
.

Please ensure that you use unused user- and group-ids. Next, we create the configuration and set up some chmod'es:

# cd ../usr
# chown 99.99 /usr/yaku-ns
# chmod 700 /usr/yaku-ns
# chown 0.0 /usr/yaku-ns/*
# chmod 755 /usr/yaku-ns/yaku-ns
# touch /usr/yaku-ns/yaku-ns.log
# chown 99.99 /usr/yaku-ns/yaku-ns.log
# chmod 644 /usr/yaku-ns/yaku-ns.log

Now, we set up the configuration file:

# cd yaku-ns
# cat <<. > yaku-ns.conf
acl dns.allow 192.168.1.
acl dns.deny $
nameserver aaa.bbb.ccc.ddd
.
# chown 0.0 /usr/yaku-ns/yaku-ns.conf
# chmod 644 /usr/yaku-ns/yaku-ns.conf
# exit

As you see, only three lines and you've got your own nameserver. Please change the IP address aaa.bbb.ccc.ddd to one provided by the adsl-connect script in chapter five.

For further configuration options or deepening information, please read either README or the corresponding documentation file of this source package.

Now, you've got to edit the file /etc/init.d/rcS for starting up the nameserver automagically at system boot. If you've set up your /etc/init.d/rcS like in chapter three, you only have to remove the # at the beginnig of the following lines:

 .
 .
 .
 
#echo "Starting yaku-ns..."
#/usr/yaku-ns/yaku-ns -c \
# /usr/yaku-ns/yaku-ns.conf -l \
# /usr/yaku-ns/yaku-ns.log -u yaku -d

 .
 .
 .

Otherwise, simply add the following lines to /etc/init.d/rcS:

 .
 .
 .
 
echo "Starting yaku-ns..."
/usr/yaku-ns/yaku-ns -c \
 /usr/yaku-ns/yaku-ns.conf -l \
 /usr/yaku-ns/yaku-ns.log -u yaku -d
 
 .
 .
 .

Now, our nameserver will be started at system boot.


next up previous contents index
Next: Compiling udhcp-0.9.8 Up: Setting up an own Previous: Setting up an own   Contents   Index
Christian Berger 2004-10-19