diff -aruN ../tcp_wrappers_7.6/Makefile ./Makefile
--- ../tcp_wrappers_7.6/Makefile	1997-03-22 03:27:21.000000000 +0900
+++ ./Makefile	2004-08-23 22:49:49.000000000 +0900
@@ -664,7 +664,7 @@
 	-DREAL_DAEMON_DIR=\"$(REAL_DAEMON_DIR)\" $(STYLE) $(KILL_OPT) \
 	-DSEVERITY=$(SEVERITY) -DRFC931_TIMEOUT=$(RFC931_TIMEOUT) \
 	$(UCHAR) $(TABLES) $(STRINGS) $(TLI) $(EXTRA_CFLAGS) $(DOT) \
-	$(VSYSLOG) $(HOSTNAME)
+	$(VSYSLOG) $(HOSTNAME) $(DYNAMIC)
 
 LIB_OBJ= hosts_access.o options.o shell_cmd.o rfc931.o eval.o \
 	hosts_ctl.o refuse.o percent_x.o clean_exit.o $(AUX_OBJ) \
diff -aruN ../tcp_wrappers_7.6/hosts_access.c ./hosts_access.c
--- ../tcp_wrappers_7.6/hosts_access.c	1997-02-12 10:13:23.000000000 +0900
+++ ./hosts_access.c	2004-08-23 22:45:28.000000000 +0900
@@ -33,6 +33,7 @@
 #include <errno.h>
 #include <setjmp.h>
 #include <string.h>
+#include <netdb.h>
 
 extern char *fgets();
 extern int errno;
@@ -231,12 +232,46 @@
 struct request_info *request;
 {
     char   *host;
+    struct hostent* hostent ;
+    struct in_addr  in_addr ;
+    char            ip_str[32] ;
 
     if ((host = split_at(tok + 1, '@')) == 0) {	/* plain host */
-	return (host_match(tok, request->client));
+#ifdef DYNAMIC
+		if (tok[0] == '!') {
+			hostent = gethostbyname(tok+1) ;
+			if (! hostent) return (NO) ;
+			memcpy(&in_addr, hostent->h_addr, hostent->h_length) ;
+			strcpy(ip_str, inet_ntoa(in_addr)) ;
+			if (! strcmp(ip_str, eval_hostaddr(request->client))) {
+				syslog(allow_severity, "match %s by %s (%s)", tok+1, eval_client(request), ip_str);
+				return (YES) ;
+			} else {
+				return (NO) ;
+			}
+		} else
+#endif
+			return (host_match(tok, request->client));
     } else {					/* user@host */
-	return (host_match(host, request->client)
-		&& string_match(tok, eval_user(request)));
+	if (! string_match(tok, eval_user(request)))
+		return (NO) ;
+	else {
+#ifdef DYNAMIC
+		if (tok[0] == '!') {
+			hostent = gethostbyname(host) ;
+			if (! hostent) return (NO) ;
+			memcpy(&in_addr, hostent->h_addr, hostent->h_length) ;
+			strcpy(ip_str, inet_ntoa(in_addr)) ;
+			if (! strcmp(ip_str, eval_hostaddr(request->client))) {
+				syslog(allow_severity, "match %s by %s (%s)", tok+1, eval_client(request), ip_str);
+				return (YES) ;
+			} else {
+				return (NO) ;
+			}
+		} else
+#endif
+			return (host_match(host, request->client)) ;
+    	}
     }
 }
 
