diff -urN origsrc/comm.c src/comm.c
--- origsrc/comm.c	Fri Oct  6 13:46:20 2000
+++ src/comm.c	Tue Dec 19 03:11:28 2000
@@ -104,6 +104,7 @@
 FILE *logfile = NULL;		/* Where to send the log messages. */
 
 /* functions in this file */
+char *hostname(struct sockaddr_in *inf);
 RETSIGTYPE reread_wizlists(int sig);
 RETSIGTYPE unrestrict_game(int sig);
 RETSIGTYPE reap(int sig);
@@ -1188,7 +1189,7 @@
   static int last_desc = 0;	/* last descriptor number */
   struct descriptor_data *newd;
   struct sockaddr_in peer;
-  struct hostent *from;
+  char *from = NULL;
 
   /* accept the new connection */
   i = sizeof(peer);
@@ -1219,20 +1220,13 @@
   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';
+  if (nameserver_is_slow) /* use numeric site name, or... */
+    strncpy(newd->host, inet_ntoa(peer.sin_addr), HOST_LENGTH);
+  else {
+    from = hostname(&peer);
+    strncpy(newd->host, from, HOST_LENGTH);
   }
+  *(newd->host + HOST_LENGTH) = '\0';
 
   /* determine if the site is banned */
   if (isbanned(newd->host) == BAN_ALL) {
@@ -2385,3 +2379,79 @@
 }
 
 #endif /* CIRCLE_WINDOWS */
+
+
+/****************************************************************************
+* SimpleDNS, By D. Tyler Barnes                                             *
+* Feel free to change the EXPIRE_TIME definition, it's in days.             *
+****************************************************************************/
+
+#define EXPIRE_TIME 14
+#define DAYS 86400   /* Don't change this one, stupid. */
+
+/* Find name in DNS cache, or using gethostbyaddr if that fails */
+char *hostname(struct sockaddr_in *inf) {
+
+    struct cache_entry {
+        char ip[4];                /* IP address */
+        char hname[HOST_LENGTH+1]; /* Host name */
+        time_t time_exp;           /* Time this entry expires */
+    };
+
+    FILE *f;
+    int freerec = -1;
+    time_t now;
+    struct hostent *lookup;
+    bool found = 0;
+    static struct cache_entry rec;
+    char addr[4];
+
+    memcpy(addr,(char *)&inf->sin_addr, sizeof(addr));
+
+    touch(DNSCACHE_FILE);
+
+    if (!(f = fopen(DNSCACHE_FILE, "r+b"))) {
+        log("SYSERR: Could not open DNS cache file!");
+        strcpy(rec.hname, "DNS Cache Error");
+    } else {
+        now = time(0);/* might as well not waste time checking in the loop */
+        for(;found == 0;) {
+
+            fread(&rec, sizeof(struct cache_entry), 1, f);
+
+            if (feof(f))
+                break;
+
+             /* Set freerec to the offset of the first expired record */
+             if ((now >= rec.time_exp) && freerec == -1)
+                freerec = (ftell(f) - sizeof(struct cache_entry));
+
+             if (!memcmp(rec.ip, addr, sizeof(addr)))
+                found = 1;
+
+        }
+
+        /* Entry not found, use gethostbyaddr and store it in record *
+         * number freerec. freerec = -1 means store at EOF           */
+        if (found == 0) {
+
+            if (freerec != -1) /* Seek to expired record */
+                fseek(f, freerec, SEEK_SET);
+
+            memcpy(rec.ip, addr, sizeof(rec.ip));
+
+            lookup = gethostbyaddr(addr, sizeof(addr), AF_INET);
+            if (lookup)
+                strncpy(rec.hname, lookup->h_name, HOST_LENGTH);
+            else {
+                /* Lookup failed, store numeric address */
+                strncpy(rec.hname, inet_ntoa(inf->sin_addr), HOST_LENGTH);
+                *(rec.hname + HOST_LENGTH) = '\0';
+            }
+            rec.time_exp = time(0) + (EXPIRE_TIME * DAYS);
+            fwrite(&rec, sizeof(struct cache_entry), 1, f);
+        }
+        fclose(f);
+    }
+    return(rec.hname);
+}
diff -urN origsrc/db.h src/db.h
--- origsrc/db.h	Fri Oct  6 13:46:20 2000
+++ src/db.h	Tue Dec 19 03:07:06 2000
@@ -91,6 +91,7 @@
 #define XNAME_FILE	LIB_MISC"xnames" /* invalid name substrings	*/
 
 #define PLAYER_FILE	LIB_ETC"players" /* the player database		*/
+#define DNSCACHE_FILE LIB_ETC"dns.cache"
 #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	*/
