From 8fbb67818b1b02bcff4231ffc9eba2ba3e4ccf96 Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Sat, 22 Feb 2003 22:34:40 +0000 Subject: [PATCH] - Added set::options::dont-resolve (=hostnames of incomming clients won't be resolved). This is more usefull than the no nameserver + useip solution since with this no resolving is done for incomming clients, but connecting to other servers (with hostnames) still works fine ;P. --- Changes | 1 + doc/unreal32docs.html | 4 ++++ include/dynconf.h | 2 ++ src/s_bsd.c | 3 +++ src/s_conf.c | 5 +++++ 5 files changed, 15 insertions(+) diff --git a/Changes b/Changes index 9d3f2621b..72688bb93 100644 --- a/Changes +++ b/Changes @@ -1938,3 +1938,4 @@ seen. gmtime warning still there quit messages you create a badword quit {}. Additionally loading badwords.quit.conf will censor several badwords by default. Based on suggestions by Gargo - Fixed two ident bugs (multihomed&connect), both resulted in ident not working. +- Added set::options::dont-resolve (=hostnames of incomming clients won't be resolved). diff --git a/doc/unreal32docs.html b/doc/unreal32docs.html index ce1c05d62..4f744b0df 100644 --- a/doc/unreal32docs.html +++ b/doc/unreal32docs.html @@ -1488,6 +1488,10 @@ loadmodule "src/modules/scan_http.so";

set::options::show-connect-info;
If present notices showing "ident request", "hostname lookup", etc. will be displayed when a user connects.

+

set::options::dont-resolve;
+ If present hosts of incomming users are not resolved, can be usefull if many of your + users don't have a host to speed up connecting.
+ Note that since no resolving is done you also can't have host based allow blocks.

set::dns::timeout <timevalue>;
A time value specifying the length of time a DNS server has to respond before a timeout. A time value is a numeric string with d meaning days, h meaning hours, diff --git a/include/dynconf.h b/include/dynconf.h index 9179c230a..961564a75 100644 --- a/include/dynconf.h +++ b/include/dynconf.h @@ -61,6 +61,7 @@ struct zConfiguration { unsigned ident_check:1; unsigned fail_oper_warn:1; unsigned show_connect_info:1; + unsigned dont_resolve:1; unsigned use_egd; long host_timeout; int host_retries; @@ -103,6 +104,7 @@ extern aConfiguration iConf; #define MAXCHANNELSPERUSER iConf.maxchannelsperuser #define WEBTV_SUPPORT iConf.webtv_support #define NO_OPER_HIDING iConf.no_oper_hiding +#define DONT_RESOLVE iConf.dont_resolve #define AUTO_JOIN_CHANS iConf.auto_join_chans #define OPER_AUTO_JOIN_CHANS iConf.oper_auto_join_chans #define HOST_TIMEOUT iConf.host_timeout diff --git a/src/s_bsd.c b/src/s_bsd.c index 03718afe7..7a5553683 100644 --- a/src/s_bsd.c +++ b/src/s_bsd.c @@ -1329,6 +1329,8 @@ void start_of_normal_client_handshake(aClient *acptr) } lin.flags = ASYNC_CLIENT; lin.value.cptr = acptr; + if (DONT_RESOLVE) + goto skipdns; Debug((DEBUG_DNS, "lookup %s", acptr->sockhost)); acptr->hostp = gethost_byaddr((char *)&acptr->ip, &lin); @@ -1340,6 +1342,7 @@ void start_of_normal_client_handshake(aClient *acptr) sendto_one(acptr, "%s", REPORT_FIN_DNSC); } nextdnscheck = 1; +skipdns: start_auth(acptr); } diff --git a/src/s_conf.c b/src/s_conf.c index 77ca5e6df..3d32586f8 100644 --- a/src/s_conf.c +++ b/src/s_conf.c @@ -4837,6 +4837,9 @@ int _conf_set(ConfigFile *conf, ConfigEntry *ce) else if (!strcmp(cepp->ce_varname, "show-connect-info")) { tempiConf.show_connect_info = 1; } + else if (!strcmp(cepp->ce_varname, "dont-resolve")) { + tempiConf.dont_resolve = 1; + } } } else if (!strcmp(cep->ce_varname, "hosts")) { @@ -5121,6 +5124,8 @@ int _test_set(ConfigFile *conf, ConfigEntry *ce) } else if (!strcmp(cepp->ce_varname, "show-connect-info")) { } + else if (!strcmp(cepp->ce_varname, "dont-resolve")) { + } else { config_error("%s:%i: unknown option set::options::%s",