BIND 8.1.2 for OS/2

Installing BIND

Prerequisites

I haven't filled in the required versions above because I don't have any systems to test it on. Please send me a mail if you are running this package on other versions of OS/2 than Warp 4.

I have successfully tested this package on Warp 4 with TCP/IP 4.0 and 4.1 myself. Note that TCP/IP 4.1 requires EMX 0.9c fix 4 or later.

Installation

You have probably unzipped the archive to a temporary location like y:\xxx\bind. To install, move the following files from y:\xxx\bind\bin to a directory in your %PATH%
  named.exe
  named-xfer.exe
  emxkill.exe
  ndc.cmd
Optionally, you may also want to put these tools in the same directory:
  nslookup.exe
  dig.exe
  dnsquery.exe
  host.exe
  addr.exe
  nsupdate.exe
  nssig.cmd
Move this file from y:\xxx\bind\etc to your ETC directory
  nslookup.help

Quick setup guide for a caching-only server

  1. Put the conf file in your ETC directory
      cd %ETC%
      copy y:\xxx\bind\etc\samples\named.conf 
    
  2. Create a database directory in your ETC directory
      md namedb
    
  3. Switch to the database directory
      cd namedb
    
  4. Copy database files into it
      copy y:\xxx\bind\etc\samples\127.0.0.zone
      copy y:\xxx\bind\etc\samples\root.hint
      copy y:\xxx\bind\etc\samples\localhost.zone
      copy y:\xxx\bind\etc\samples\bogus.zone
    
  5. Edit named.conf and update the directory option
      epm named.conf
    
  6. Start the server
      ndc start
    
Thanks a lot to Ed Tomlinson for this step-by-step guide.

Setting up a name server for a small home network

OK, so you've got the caching name server running just fine and want to add names for a handful of PCs in your home network. This is really a very simple task, and I did think about including a couple of examples here.

But after thinking more about it, I decided not to since

  1. I am not a DNS expert, and
  2. there are a zillion correct ways to write a zone file, and
  3. you really should know a little about what you are doing. It is better to read and learn than just to copy an example.

You can find a lot of documentation, recommended reading, and examples in the DNS resources directory. Note that most examples will use the old BIND 4.x boot file format which is not compatible with BIND 8.1.1. See the BIND Configuration File Guide for documentation and examples of a BIND 8 config file.

The zone data file format has not changed, and examples of such files can therefore be copied directly.

If you just make sure that you haven't done any of the common errors listed in RFC 1912, then you have done very well. Better than for example aol.com (and if you can find the error in the aol.com zone, then maybe you can get a job as DNS technician there :-)

Upgrading from BIND 4.9.x (or the IBM DDNS)

NOTE: You cannot upgrade from the DDNS if you are using its dynamic function.

I assume you have a working setup, and are somewhat familiar with DNS zone data files. You need to know what a zone is to make a configuration file, but there is no need to edit the zone files (unless BIND detects errors in them).

The named.boot file (or NAMED.BT in IBM's DDNS) has been replaced by the much more configurable named.conf in BIND 8.x. You should study the BIND Configuration File Guide carefully to learn about the new syntax. There is a perl script (bin\named-bootconf.pl) which will upgrade your old named.boot to the new format. You will of course need access to a system with perl to run this script. I tested it with the OS/2 port of perl5, and it seemed to work just fine.

Using this script is strongly recommended if you run a server with more than a couple of zones.

Quick upgrade

If you have installed perl, run
  perl5 y:\xxx\bind\bin\named-bootconf.pl < %ETC%\namedb\named.boot > %ETC%\named.conf
to create a configuration file from your old named.boot file.

If you don't have perl, you will have to write a named.conf file by hand:

  1. Use the sample named.conf as a template
      cd %ETC%
      copy y:\xxx\bind\etc\samples\named.conf 
    
  2. Update the directory option
  3. Add zone definitions for all your master (previously primary) and slave (previously secondary) zones. A couple of examples:
    zone "bind.org" IN {
    	type master;
    	file "db.bind.org";
    };
    zone "168.192.in-addr.arpa" IN {
    	type master;
    	file "db.192.168";
    };
    zone "bog.com" IN {
    	type slave;
    	file "db.bog.com";
    	masters {
    		10.10.2.224;
    	};
    };
    
  4. Kill your old server
  5. Start BIND 8.1.2
      ndc start
    
NOTE: Keep your old named.boot and don't change the zone data file names. Then, if something goes wrong, you can just fire up your old server again.

Detecting errors

You should run a syslog daemon together with BIND. All error messages and warnings will be written to this daemon (and hence lost if you don't have one). Use the syslogd included with Warp 4, or get one from hobbes.nmsu.edu or www.leo.org.

The Changi Manual has excellent instructions on how to set up syslogd. And while you're there, check out Changi! This is the NNTP server for OS/2. You say don't need an NNTP server? How about an offline news solution for Netscape or NR/2?

Well, back to subject: BIND will write somthing like this to the syslog when it starts:

[localhost] May 12 23:06:51 named[91]: starting.  named 8.1.2 Tue May 12 22:28:04 CED 1998
	bjorn@ballingway.mork.no:D:/bind-812/src/bin/named
[localhost] May 12 23:06:51 named[91]: directory . is world-writable
[localhost] May 12 23:06:51 named[91]: cannot set resource limits on this system
[localhost] May 12 23:06:51 named[91]: directory d:\mptn\etc\namedb is world-writable
[localhost] May 12 23:06:51 named[91]: cannot set resource limits on this system
[localhost] May 12 23:06:51 named[91]: master zone "localhost" (IN) loaded (serial 1)
[localhost] May 12 23:06:51 named[91]: master zone "127.in-addr.arpa" (IN) loaded (serial 1)
[localhost] May 12 23:06:51 named[91]: master zone "0.in-addr.arpa" (IN) loaded (serial 1)
[localhost] May 12 23:06:51 named[91]: master zone "255.in-addr.arpa" (IN) loaded (serial 1)
[localhost] May 12 23:06:51 named[91]: cache zone "" (IN) loaded (serial 0)
[localhost] May 12 23:06:51 named[91]: listening on [127.0.0.1].53 (lo)
[localhost] May 12 23:06:51 named[91]: listening on [192.168.3.7].53 (lan0)
[localhost] May 12 23:06:51 named[91]: Forwarding source address is [0.0.0.0].52253
[localhost] May 12 23:06:51 named[92]: Ready to answer queries.
You should watch these messages carefully whenever you update your data files. Watch out for messages like zone rejected due to errors, since this will cause your server to answer non-authoratively for those zones.

The four warning messages cannot set.. and directory is... are normal on an OS/2 system. I did not remove these for two reasons:

You may also note a couple of other interesting items: You can turn on heavy debugging messages with the ndc trace and ndc querylog commands.
Warning: The binaries in this distribution were compiled with QUERYLOG enabled. Turning on query logging will make your hard drive spin a lot. Better have a few gigs available...

Debugging information is written to named.run in the database directory (except for startup messages, which are saved in the startup directory).

Default file locations

If you do not specify a location, named.exe will look for named.conf in the its startup directory! This is probably not what you wanted. To play it safe, always specify the location, especially in startup scripts like TCPEXIT.CMD.

If you want to keep named.conf in %ETC% (recommended), use either

  cd %ETC%
  named
or
  named -c %ETC%\named.conf
or
  ndc start
NOTE: Unless you edit it, ndc.cmd will always look for named.pid and named.conf in %ETC%, regardless of any named startup parameters or config options.

File nameDefault locationHow to move
named.exe%PATH%Must be in %PATH% if you want to use ndc
named-xfer.exe%PATH%named.conf options
ndc.cmd%PATH%
nslookup.exe
dig.exe
dnsquery.exe
host.exe
addr.exe
nsupdate.exe
emxkill.exe%PATH%Must be in %PATH% (required by ndc)

named.confstartup directory [1]named -c my.conf [2]
named.runrun direcory [3]
namedb/ directorynamed.conf options
named.pid%ETC%named.conf options [2]

nslookup.help%ETC% [4]
resolv2%ETC%
.nslookuprc%HOME%

named_dump.db%TEMP%named.conf options
named.stats%TEMP%named.conf options
xfer.trace%TEMP%
xfer.ddt.XXXXXXrun directory

Tips

SET PAGER=less will make nslookup use less for viewing text files (including its help file).

If you need to set a non-default root server or port number for nslookup, put SET HOME=x:\somewhere in CONFIG.SYS and create x:\somewhere\.nslookuprc with the options you want as defaults. See nslookup.help for a list of options.

If you only want to change the local domain, you can do this with the domain/search directives in %ETC%\resolv2, or by setting the environment variable LOCALDOMAIN. If none of these are found, nslookup will get the local domain from your hostname.

Known problems

Bind 4.9.5 also had the first problem. A quick scan of the code shows that BIND is blocking with select() most of the time. Conclusion: The problem must be in select() in the EMX library. Or is that wrong? But it doesn't matter after all, since there's no impact on the machine load. It is a little annoying having bind on top of "Top" all the time, though.

I can fix the second problem by faking the protection, telling BIND that the files are protected even though they are not. But I have a feeling that this would be The Wrong Thing™ to do. The warnings are legitimate. Therefore I decided to keep them. But I am open for input on this one.

The third problem is worse. I cannot fix this without editing the code or placing named.run in a fixed place. But that would have to be C:\, and after all, not even that location is guaranteed to be available.

A temporary fix would be to always start named from the database directory when you are using the debug option (-d x).

The dig ping option uses a shell command (ping -s server_name 56 3 | tail -3) to do the job. This will fail in OS/2 since ping does not have a -s option, and since most OS/2 users do not have tail installed.

I have never felt the need for the ping option, and I won't fix it unless someone asks me to. I would prefer that it was either removed or fixed by the BIND maintainers.

Please report other bugs to bjorn@mork.no

Documentation

BIND Version 8 Online Documentation

comp.protocols.tcp-ip.domains Frequently Asked Questions

Manual pages

Since I don't expect the ordinary OS/2 user to have troff etc. installed, I converted[5] all the BIND manual pages to HTML.

Where do I find

more documentation?
The documentation included with OS/2 BIND is only a small subset of the BIND documentation package. You may want to check out the rest of it (gzipped tar). You will also need tools for viewing postscript files and manual pages.
the source?
Download it from the Internet Software Consortium.
the latest release of this OS/2 port?
I will upload new versions to both ftp.leo.org and hobbes.nmsu.edu. You can download it from your favourite mirror site.
the latest version of the BIND 8 online documentation?
Get it from the Internet Software Consortium.
this document?
I don't plan on updating this documentation too often... but I'll put it on my providers server so you can check for yourself :-)
an OS/2 port of BIND 4.9.x?
Take a look at Peter Meerwald's BIND pages

History

13 Aug 1997
Initial release: bind811a.zip
16 Aug 1997
Added documentation (this file + manual pages)
Fixed the sample configuration which I broke when testing the initial release
Minor fixes in ndc.cmd and fix_ioctl.c
17 Aug 1997
Changed %ETC%\resolv to %ETC%\resolv2
Fixed nslookup so it will find %HOME%\.nslookuprc
Fixed a serious bug that prevented slave zones from being updated
=> New release required: bind811b.zip
18 Aug 1997
Removed the ugly ioctl hack, thanks to Paul Ratcliffe.
Found that the slave zone bug was still in the distributed source. However, not in the binaries. So it would only affect those who rebuild. Difficult to explain how I managed to do this, but one can conclude: I need a quality assurance system.
2 Nov 1997
Released bind811c.zip with all the small fixes since bind811b.zip. There are no major fixes in this release, but the elimination of the ioctl hack is necessary to make BIND fuction correcly on systems using aliased addresses or more than two serial interfaces. ndc.cmd has also been improved.
12 May 1998
Released bind812a.zip which is a port of the latest release from ISC. No changes in the OS/2 patches

Future plans

Acknowledgements

The following have contributed, with or without their knowledge, to the development of BIND version 8 for OS/2:
Eberhard Mattes
with his excellent EMX library one cannot longer call it porting; it's just compiling...
Peter Meerwald
who ported BIND 4.9.5 to OS/2. I had a lot of help from his 4.9.5 source, and I also stole rename.c from him. I hope he can forgive me...
Garey Smiley
who wrote emxkill for the OS/2 port of Apache 1.1.3, from where I just lifted it. Garey also contributed the makefolder script.
Ed Tomlinson
who contributed the very consise setup guide, and who helped me find errors in the sample configuration...
Mike Nice
who found the bug that made the second release necessary...
Paul Ratcliffe
who never gave up convincing me that SIOCGIFCONF is working. With his help, the last of the very-bad-hacks was removed...
John Summerfield
who provided the excellent web forum, and also gave a helping hand with ReXX...
Internet Software Consortium
who have made BIND as portable as it is, and continue to deliver high quality free software. If you think BIND is too good to be free, check out their sponsor pages...
Andrew Hood
who wrote some useful addon utilities...
Kai Uwe Rommel
who has ported a zillion useful UN*X utilities...
and all those I forgot. My memory is far from error correcting. Send me a mail if you should be on the list.


[1] This is the default compiled into named.exe. The ndc start default is %ETC%

[2] ndc.cmd will always look for this file in the %ETC% directory, so that's where you should put it. Unless you edit ndc.cmd to reflect your choice, of course.

[3] This will be both the startup directory during initialisation and the DB directory afterwards. I.e. if you start named with the debug flag, you will get a named.run file in two different locations. Sorry about that, but this was one of the directories that had to be fixed. And I wouldn't want to assume that a fixed location was available. After all, there are systems where you cannot write to C:\

[4] This differs from the BIND 4.9.5 port, which expected this file to be in x:\tcpip\help. I made this change because there is no simple way to detect the location of x:\tcpip. It's much simpler to use %ETC% since it will always be defined.

[5] I used a utility called PolyglotMan to do this. PolyglotMan was a very pleasant surprise: it compiled directly on my OS/2 system, without any changes. If you are interested, the latest version is available via anonymous ftp from ftp.cs.berkeley.edu
If you need a precompiled OS/2 version, ask me to send you a copy.


HTML 3.2 Checked! Last updated Tue May 12 1998 by Bjørn Mork