diff -uNrp ../src/comm.c ./comm.c
--- ../src/comm.c	Sun Jan 23 14:21:32 2000
+++ ./comm.c	Sat Dec 23 22:32:57 2000
@@ -119,6 +119,7 @@ int get_from_q(struct txt_q *queue, char
 void init_game(ush_int port);
 void signal_setup(void);
 void game_loop(socket_t mother_desc);
+void resolve_active_IPs();
 socket_t init_socket(ush_int port);
 int new_descriptor(socket_t s);
 int get_max_players(void);
@@ -1188,7 +1189,6 @@ int new_descriptor(int s)
   static int last_desc = 0;	/* last descriptor number */
   struct descriptor_data *newd;
   struct sockaddr_in peer;
-  struct hostent *from;
 
   /* accept the new connection */
   i = sizeof(peer);
@@ -1218,21 +1218,9 @@ int new_descriptor(int s)
   CREATE(newd, struct descriptor_data, 1);
   memset((char *) newd, 0, sizeof(struct descriptor_data));
 
-  /* find the sitename */
-  if (nameserver_is_slow || !(from = gethostbyaddr((char *) &peer.sin_addr,
-				      sizeof(peer.sin_addr), AF_INET))) {
-
-    /* resolution failed */
-    if (!nameserver_is_slow)
-      perror("SYSERR: gethostbyaddr");
-
-    /* find the numeric site address */
-    strncpy(newd->host, (char *)inet_ntoa(peer.sin_addr), HOST_LENGTH);
-    *(newd->host + HOST_LENGTH) = '\0';
-  } else {
-    strncpy(newd->host, from->h_name, HOST_LENGTH);
-    *(newd->host + HOST_LENGTH) = '\0';
-  }
+  /* stick numeric IP in host until we get the full name back */
+  strncpy(newd->host, inet_ntoa(peer.sin_addr), HOST_LENGTH);
+  *(newd->host + HOST_LENGTH) = '\0';
 
   /* determine if the site is banned */
   if (isbanned(newd->host) == BAN_ALL) {
@@ -1278,6 +1266,10 @@ int new_descriptor(int s)
   newd->next = descriptor_list;
   descriptor_list = newd;
 
+  /* Now it's safe to start up the DNS lookup */
+  sprintf(buf, "../bin/lookup %d %s &", (int) getpid(), newd->host);
+  system(buf);
+
   SEND_TO_Q(GREETINGS, newd);
 
   return (0);
@@ -1975,6 +1967,50 @@ RETSIGTYPE hupsig(int sig)
 				 * substituted */
 }
 
+void resolve_active_IPs()
+{
+    FILE *f;
+    struct descriptor_data *d;
+    char ipbuf[128];
+    char hostbuf[128];
+
+    f = fopen(DNS_FILE, "rt");
+    if (!f)
+    {
+        return; /* abort if we can't open, might lose a DNS */
+    }
+
+    while (!feof(f))
+    {
+        fscanf(f, "%s %s\n", ipbuf, hostbuf);
+
+        for (d = descriptor_list; d ; d = d->next) {
+            if(d->host && !strcmp(d->host, ipbuf))
+	    {
+                strncpy(d->host, hostbuf, HOST_LENGTH);
+                *(d->host + HOST_LENGTH) = '\0';
+
+		/* determine if the site is banned */
+		if (isbanned(d->host) == BAN_ALL) {
+		  STATE(d) = CON_CLOSE;
+		  log("Connection attempt denied from [%s]", d->host);
+		}
+            }
+        }
+    }
+
+    if(f) fclose(f);
+
+    /* Empty the file - remove (or change) this if you wish to have a DNS cache */
+    f = fopen(DNS_FILE, "wt");
+    fclose(f);
+}
+
+RETSIGTYPE dnssig(int sig)
+{
+    resolve_active_IPs();
+}
+
 #endif	/* CIRCLE_UNIX */
 
 /*
@@ -2023,10 +2059,17 @@ void signal_setup(void)
   my_signal(SIGUSR1, reread_wizlists);
 
   /*
+   * user signal 2: slurp in some DNS's from the DNS file.
+   */
+  my_signal(SIGUSR2, dnssig);
+
+  /* REMOVED so that DNS could use SIGUSR2. Pick a new signal for it
+   * if you want both.
    * user signal 2: unrestrict game.  Used for emergencies if you lock
    * yourself out of the MUD somehow.  (Duh...)
-   */
+
   my_signal(SIGUSR2, unrestrict_game);
+  */
 
   /*
    * set up the deadlock-protection so that the MUD aborts itself if it gets
diff -uNrp ../src/db.h ./db.h
--- ../src/db.h	Sun May  9 19:06:20 1999
+++ ./db.h	Sat Dec 23 20:27:24 2000
@@ -94,6 +94,7 @@
 #define MAIL_FILE	LIB_ETC"plrmail" /* for the mudmail system	*/
 #define BAN_FILE	LIB_ETC"badsites" /* for the siteban system	*/
 #define HCONTROL_FILE	LIB_ETC"hcontrol"  /* for the house system	*/
+#define DNS_FILE        LIB_ETC"dns"       /* communciates with lookup  */
 
 /* public procedures in db.c */
 void	boot_db(void);
diff -uNrp ../src/util/Makefile ./util/Makefile
--- ../src/util/Makefile	Sat Dec 23 22:49:13 2000
+++ ./util/Makefile	Sat Dec 23 20:27:24 2000
@@ -24,7 +24,7 @@ CFLAGS = -g -O2 $(MYFLAGS) $(PROFILE) -I
 
 default: all
 
-all: $(BINDIR)/autowiz $(BINDIR)/delobjs $(BINDIR)/listrent \
+all: $(BINDIR)/autowiz $(BINDIR)/delobjs $(BINDIR)/listrent $(BINDIR)/lookup \
 	$(BINDIR)/mudpasswd $(BINDIR)/play2to3 $(BINDIR)/purgeplay \
 	$(BINDIR)/shopconv $(BINDIR)/showplay $(BINDIR)/sign $(BINDIR)/split \
 	$(BINDIR)/wld2html
@@ -33,6 +33,8 @@ autowiz: $(BINDIR)/autowiz
 
 delobjs: $(BINDIR)/delobjs
 
+lookup: $(BINDIR)/lookup
+
 listrent: $(BINDIR)/listrent
 
 mudpasswd: $(BINDIR)/mudpasswd
@@ -62,6 +64,9 @@ $(BINDIR)/delobjs: delobjs.c $(INCDIR)/c
 $(BINDIR)/listrent: listrent.c $(INCDIR)/conf.h $(INCDIR)/sysdep.h \
 	$(INCDIR)/structs.h
 	$(CC) $(CFLAGS) -o $(BINDIR)/listrent listrent.c
+
+$(BINDIR)/lookup: lookup.c $(INCDIR)/conf.h $(INCDIR)/sysdep.h
+	$(CC) $(CFLAGS) -o $(BINDIR)/lookup lookup.c
 
 $(BINDIR)/mudpasswd: mudpasswd.c $(INCDIR)/conf.h $(INCDIR)/sysdep.h \
 	$(INCDIR)/structs.h $(INCDIR)/utils.h
diff -uNrp ../src/util/lookup.c ./util/lookup.c
--- ../src/util/lookup.c	Wed Dec 31 18:00:00 1969
+++ ./util/lookup.c	Sat Dec 23 22:23:57 2000
@@ -0,0 +1,95 @@
+/*
+ \file    lookup.c
+ \brief   Resolves an IP through DNS and stores results in a file.
+ \author  Derrick Coetzee
+          $Date: 2000/12/24 04:23:28 $
+
+ Meant to be called from CircleMUD, resolves an IP synchronously
+ (but asynchronously from the main MUD process) and stores the
+ results in a DNS file. It then signals the MUD, which (in
+ resolve_active_IPs() in comm.c) reads the results out.
+ 
+ lookup can also be called from a shell by putting 0 for the
+ pid. If you do this, you may wish to remove the lines that
+ clean out the file in resolve_active_IPs().
+*/
+
+#include "conf.h"
+#include "sysdep.h"
+
+#include "structs.h"
+#include "utils.h"
+
+#include "db.h"       /* FILE_DNS */
+
+#include <signal.h>
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+int main(int argc, char **argv)
+{
+  struct hostent *from;
+  struct in_addr peer;
+  FILE *f;
+
+  int pid = 0;
+
+  char ipbuf[128];
+  char hostbuf[128];
+
+  if (argc < 3)
+  {
+      return -1;
+  }
+
+  pid = atoi(argv[1]);
+
+  f = fopen(DNS_FILE, "rt");
+  if (!f)
+  {
+      f = fopen(DNS_FILE, "wt");
+      if (!f)
+      {
+	  return -1; /* abort if we can't open, might lose a DNS */
+      }
+  }
+
+  while (!feof(f))
+  {
+      if (fscanf(f, "%s %s\n", ipbuf, hostbuf) < 2)
+      {
+	  break;
+      }
+      if(!strcmp(ipbuf, argv[2]))
+      {
+	  /* Already cached */
+	  fclose(f);
+	  if (pid) kill(pid, SIGUSR2);
+	  return 0;
+      }
+  }
+
+  fclose(f);
+
+  inet_aton(argv[2], &peer);
+
+  if ( !(from = gethostbyaddr((char *)&peer.s_addr, sizeof(peer.s_addr), AF_INET)) )
+  {
+      /* Failed, shhh, let the MUD run on with a numeric IP */
+      return -1;
+  }
+  
+  // Successful, add to DNS file and signal MUD
+  f = fopen(DNS_FILE, "at");
+  if (!f)
+  {
+      return -1; /* abort if we can't open, might lose a DNS */
+  }  
+  fprintf(f, "%s %s\n", argv[2], from->h_name);
+  fclose(f);
+
+  if (pid) kill(pid, SIGUSR2);
+  return 0;
+}

