lpmoo-1.2/etc/
lpmoo-1.2/mudlib/
lpmoo-1.2/mudlib/etc/
lpmoo-1.2/mudlib/include/
lpmoo-1.2/mudlib/include/moo/
lpmoo-1.2/mudlib/lpc/
lpmoo-1.2/mudlib/std/auto/
lpmoo-1.2/mudlib/std/bfuns/
Enabling Name/Address Resolution
================================

LPMOO relies on an external daemon process to resolve hostnames and IP
addresses using DNS. This document describes how to modify your database to
allow DNS lookups to be performed.

Without modifying your database, you will be limited to working strictly with
IP addresses, both in the values returned by connection_name() and with calls
to open_network_connection().

The trick is to let :do_login_command() return the string "/lib/dns" when the
DNS resolver daemon connects to the server.

In a database based on LambdaCore, one way to do this is:

  - create a child of $player named "generic LPC daemon", call it $lpc_daemon
  - create a prop on $lpc_daemon called .lpc_object
  - create a new player named "DNS", remember its password
  - chparent DNS to $lpc_daemon
  - set DNS.lpc_object to "/lib/dns"
  - edit $login:connect, near the end, just before `return candidate', insert:

        if ($object_utils:isa(candidate, $lpc_daemon))
          return candidate.lpc_object;
        endif

The DNS daemon itself is a small program written in C. You must edit the file
../etc/dns.cf to indicate the hostname/port to which the daemon should connect
(which should be your normal login port). You will also need to indicate what
string the daemon should send in order to be attached to /lib/dns as described
above. If you followed the above instructions verbatim, you should only need
to fill in the correct password.

For your hacking pleasure, an equivalent version of the DNS daemon, written in
Perl, is included but not used in this release. It is in ../src/dnsbot.pl.

To make the daemon attach to an already running LPMOO, type:

    make dns

To run the daemon regularly upon restarting the server, start the server with:

    make run dns