Date: Sat, 22 Feb 1997 17:15:26 -0700 (MST) From: Marc Slemko <marcs@znep.com> To: Jason Fesler <jfesler@calweb.com> Cc: freebsd-isp@FreeBSD.org Subject: Re: Apache Message-ID: <Pine.BSF.3.95.970222170304.27854D-100000@alive.znep.com> In-Reply-To: <Pine.BSF.3.95.970212121334.7569A-100000@alive.ampr.ab.ca>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 12 Feb 1997, Marc Slemko wrote: > On Tue, 11 Feb 1997, Jason Fesler wrote: > > > At 11:33 AM 2/10/97 -0800, Dan Busarow wrote: > > >> Does it have to do with the number of V hosts? Is 125 really high? > > > > > >It might. If you're running named on this machine it may be having > > >problems caused by binding to all the addresses. If you are running > > >named on this machine try turning it off and pointing to another > > >nameserver in /etc/resolv.conf > > > > We have *definately* seen this behavior; I've also read about this in > > an FAQ somewhere (where, I don't remember... the grey matter upstairs > > went on strike). We *tried* to run DNS on such a server (400 hosts), > > and it kept dying, not starting, etc *after* the IP aliases were defined. > > It would do fine if we started *before*. We ended up moving the DNS > > server to a different machine (it was only a secondary) instead of > > reading the source code due to time constraints. > > There is a patch that someone (Mark Andrews?) made available once that > adds a directive to specify which addreses named should listen on. I have > it around somewhere, updated for a recent version of BIND, and can make it > available if people want. Ok, Jason asked for this... sorry it took a while. It is against the raw 4.9.5-P1 source; you should be able to make it apply to the source in the FreeBSD tree, but some effort may be needed. To set it up, apply the patch and recompile, then add a line like: interface 127.0.0.1 10.0.1.1 10.1.2.2 to your named.boot, where the IPs are those of the interfaces you want it to listen on. Note that you most likely do not want to leave out the loopback or bad things will happen. Works fine for me but, as always, YMMV. It has been around for long enough here that I don't remember who wrote it, but ISTR that it may have been Mark Andrews. --- conf/options.h 1996/06/28 17:35:52 1.1 +++ conf/options.h 1996/07/06 00:54:19 @@ -120,6 +120,7 @@ /*#define BIND_NOTIFY /* experimental - do not enable in customer products */ #define LOC_RR /* support for LOC record parsing (ckd/vix) */ #define SORT_RESPONSE /* should we try to sort responses optimally? (vix) */ +#define IFALIASES /*--------------------------------------------* * no user-servicable parts beyond this point * --- named/ns_glob.h 1996/07/06 00:33:11 1.1 +++ named/ns_glob.h 1996/07/06 00:39:19 @@ -174,6 +174,11 @@ DECL struct netinfo *boglist INIT(NULL); #endif +#ifdef IFALIASES + /* list of interfaces to config */ +DECL struct netinfo *ipifaddr INIT(NULL); +#endif + /* loopback net */ DECL struct netinfo netloop; --- named/ns_init.c 1996/07/06 00:33:35 1.1 +++ named/ns_init.c 1996/08/26 18:08:05 @@ -174,6 +175,10 @@ #ifdef BOGUSNS free_netlist(&boglist); #endif +#ifdef IFALIASES + free_netlist(&ipifaddr); +#endif + forward_only = 0; } @@ -308,6 +313,11 @@ get_netlist(fp, &xfrnets, ALLOW_NETS, buf); continue; #endif +#ifdef IFALIASES + } else if (strcasecmp(buf, "interface") == 0) { + get_netlist(fp, &ipifaddr, ALLOW_HOSTS, buf); + continue; +#endif #ifdef LOCALDOM } else if (strcasecmp(buf, "domain") == 0) { if (getword(buf, sizeof(buf), fp, 1)) --- named/ns_main.c 1996/07/06 00:33:22 1.1 +++ named/ns_main.c 1996/08/26 18:08:07 @@ -413,6 +414,14 @@ buildservicelist(); buildprotolist(); ns_init(bootfile); +#ifdef IFALIASES + /* + * the first pass just established the wild card address + * now that we have read the boot file, establish the interface + * spacific addresses + */ + getnetconf(); +#endif #ifdef DEBUG if (debug) { fprintf(ddt, "Network and sort list:\n"); @@ -928,7 +937,10 @@ char buf[32768], *cp, *cplim; u_int32_t nm; time_t my_generation = time(NULL); - +#ifdef IFALIASES + if (first) + goto dofirst; +#endif ifc.ifc_len = sizeof buf; ifc.ifc_buf = buf; if (ioctl(vs, SIOCGIFCONF, (char *)&ifc) < 0) { @@ -967,6 +979,16 @@ dprintf(1, (ddt, "considering [%s]\n", inet_ntoa(((struct sockaddr_in *) &ifreq.ifr_addr)->sin_addr))); +#ifdef IFALIASES + /* + * if ipifaddr is set only configure these interfaces + */ + if (ipifaddr && + !addr_on_netlist( + ((struct sockaddr_in *)&ifreq.ifr_addr)->sin_addr + , ipifaddr)) + continue; +#endif /* build datagram queue */ /* * look for an already existing source interface address. @@ -1093,6 +1115,9 @@ * Create separate qdatagram structure for socket * wildcard address. */ +#ifdef IFALIASES + dofirst: +#endif if (first) { if (!(dqp = (struct qdatagram *)calloc(1, sizeof(*dqp)))) panic(errno, "malloc(qdatagram)");
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95.970222170304.27854D-100000>