Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Jan 2001 15:25:41 +0000 (GMT)
From:      George Reid <greid@dogma.freebsd-uk.eu.org>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/24107: New port: dnrd: A proxy DNS daemon
Message-ID:  <Pine.BSF.4.21.0101061525180.49343-100000@sobek.openirc.co.uk>
Resent-Message-ID: <200101061530.f06FU1Q25479@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         24107
>Category:       ports
>Synopsis:       New port: dnrd: A proxy DNS daemon
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jan 06 07:30:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     George Reid
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
FreeBSD UKUG
>Environment:
n/a
>Description:
DNRD is a proxy name server. To clients on your home network,
it looks just like a name server. In reality, it forwards every
DNS query to the "real" DNS server, and forwards responses back
to the client.

So, why would you want to use it? DNRD was designed for home
networks where you might want to dial into more than one ISP
(ie, your home ISP and a dialup connection to your office). The
problem with multiple dialups is that you need to change
/etc/resolv.conf for each one. With DNRD, this is no longer
necessary.

Your dialup machine will run DNRD (with appropriate options for
forwarding messages to the desired DNS servers). All other
machines on the home network, including the dialup machine
itself, will use the dialup machine as its DNS server.

- George Reid
greid@ukug.uk.freebsd.org
>How-To-Repeat:
n/a
>Fix:
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	dnrd
#	dnrd/Makefile
#	dnrd/distinfo
#	dnrd/files
#	dnrd/files/patch-aa
#	dnrd/files/patch-ab
#	dnrd/files/patch-ac
#	dnrd/files/patch-ad
#	dnrd/files/patch-ae
#	dnrd/files/patch-af
#	dnrd/files/patch-ag
#	dnrd/pkg-comment
#	dnrd/pkg-descr
#	dnrd/pkg-plist
#
echo c - dnrd
mkdir -p dnrd > /dev/null 2>&1
echo x - dnrd/Makefile
sed 's/^X//' >dnrd/Makefile << 'END-of-dnrd/Makefile'
X# New ports collection makefile for:   dnrd
X# Date created:        06 January 2001
X# Whom:                George Reid <greid@ukug.uk.freebsd.org>
X#
X# $FreeBSD$
X#
X
XPORTNAME=       	dnrd
XPORTVERSION=		2.9
XCATEGORIES=     	net
XMASTER_SITES=   	http://members.home.com/garsh/dnrd/archive/
X
XMAINTAINER=		greid@ukug.uk.freebsd.org
X
XWRKSRC=			${WRKDIR}/${DISTNAME}/src
X
XUSE_GMAKE=		yes
X
XMAN8=			dnrd.8
X
Xpost-patch:
X.for F in main.c master.c
X	@(cd ${WRKSRC} && ${SED} -e 's,%%PREFIX%%,${PREFIX},g' $F > foo && \
X		${MV} foo $F)
X.endfor
X
X.include <bsd.port.mk>
END-of-dnrd/Makefile
echo x - dnrd/distinfo
sed 's/^X//' >dnrd/distinfo << 'END-of-dnrd/distinfo'
XMD5 (dnrd-2.9.tar.gz) = ba593a4e1ebff641338663430fe3edef
END-of-dnrd/distinfo
echo c - dnrd/files
mkdir -p dnrd/files > /dev/null 2>&1
echo x - dnrd/files/patch-aa
sed 's/^X//' >dnrd/files/patch-aa << 'END-of-dnrd/files/patch-aa'
X--- Makefile.orig	Wed Nov  3 00:47:10 1999
X+++ Makefile	Sat Jan  6 15:23:12 2001
X@@ -1,13 +1,13 @@
X-CC		= gcc
X-COPT		= -O2
X+CC		= cc
X+COPT		= 
X CDEF		= -D_REENTRANT
X-CWARN		= -Wall -Werror
X-CDBG		= -ggdb
X-CFLAGS		= ${CWARN} ${COPT} ${CDEF} ${CDBG}
X+CWARN		= -Wall
X+CDBG		= 
X+CFLAGS		+= ${CWARN} ${COPT} ${CDEF} ${CDBG}
X LDFLAGS		= 
X-LIBS            = -lpthread
X-INSTDIR		= /usr/local/sbin
X-MANDIR		= /usr/local/man/man8
X+LIBS            = -lc_r
X+INSTDIR		= ${PREFIX}/sbin
X+MANDIR		= ${PREFIX}/man/man8
X SHELL		= /bin/sh
X 
X all:	dnrd
X@@ -17,14 +17,13 @@
X 	rm -f dnrd core tags ID *.o *.d *~ *.bak
X 
X install: dnrd
X-	strip dnrd
X-	install -m 0751 -o root -g root -s dnrd ${INSTDIR}
X-	install -m 0644 -o root -g root -s ../doc/dnrd.8 ${MANDIR}
X+	install -m 0755 -s -o root -g wheel -s -c dnrd ${INSTDIR}
X+	install -m 0544 -o root -g wheel -c ../doc/dnrd.8 ${MANDIR}
X 
X sources = args.c cache.c common.c dns.c lib.c main.c master.c \
X 	  query.c relay.c sig.c tcp.c udp.c
X 
X-include $(sources:.c=.d)
X+#include $(sources:.c=.d)
X 
X dnrd:	$(sources:.c=.o)
X 	$(CC) $(LDFLAGS) $(LIBS) $^ -o $@
END-of-dnrd/files/patch-aa
echo x - dnrd/files/patch-ab
sed 's/^X//' >dnrd/files/patch-ab << 'END-of-dnrd/files/patch-ab'
X--- args.c.orig	Sat Jan  6 14:54:15 2001
X+++ args.c	Sat Jan  6 14:54:57 2001
X@@ -25,6 +25,7 @@
X #include <stdarg.h>
X #include <stdio.h>
X #include <stdlib.h>
X+#include <unistd.h>
X #if defined(__GNU_LIBRARY__)
X #   include <getopt.h>
X #endif
END-of-dnrd/files/patch-ab
echo x - dnrd/files/patch-ac
sed 's/^X//' >dnrd/files/patch-ac << 'END-of-dnrd/files/patch-ac'
X--- common.h.orig	Sat Jan  6 14:52:53 2001
X+++ common.h	Sat Jan  6 14:53:00 2001
X@@ -23,6 +23,7 @@
X #ifndef _DNRD_COMMON_H_
X #define _DNRD_COMMON_H_
X 
X+#include <sys/types.h>
X #include <netinet/in.h>
X #include <syslog.h>
X #include <semaphore.h>
END-of-dnrd/files/patch-ac
echo x - dnrd/files/patch-ad
sed 's/^X//' >dnrd/files/patch-ad << 'END-of-dnrd/files/patch-ad'
X--- main.c.orig	Thu Jan  4 14:40:42 2001
X+++ main.c	Sat Jan  6 15:06:31 2001
X@@ -18,6 +18,7 @@
X  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
X  */
X 
X+#include <sys/types.h>
X #include "relay.h"
X #include "cache.h"
X #include "common.h"
X@@ -26,7 +27,6 @@
X #include "master.h"
X #include <stdio.h>
X #include <stdlib.h>
X-#include <sys/types.h>
X #include <sys/stat.h>
X #include <sys/socket.h>
X #include <sys/stat.h>
X@@ -170,20 +170,20 @@
X      * Change our root and current working directories to /etc/dnrd.
X      * Also, so some sanity checking on that directory first.
X      */
X-    dirp = opendir("/etc/dnrd");
X+    dirp = opendir("%%PREFIX%%/etc/dnrd");
X     if (!dirp) {
X-	log_msg(LOG_ERR, "The directory /etc/dnrd must be created before "
X+	log_msg(LOG_ERR, "The directory %%PREFIX%%/etc/dnrd must be created before "
X 		"dnrd will run");
X     }
X 
X-    rslt = stat("/etc/dnrd", &st);
X+    rslt = stat("%%PREFIX%%/etc/dnrd", &st);
X     if (st.st_uid != 0) {
X-	log_msg(LOG_ERR, "The /etc/dnrd directory must be owned by root");
X+	log_msg(LOG_ERR, "The %%PREFIX%%/dnrd directory must be owned by root");
X 	cleanexit(-1);
X     }
X     if ((st.st_mode & (S_IWGRP | S_IWOTH)) != 0) {
X 	log_msg(LOG_ERR,
X-		"The /etc/dnrd directory should only be user writable");
X+		"The %%PREFIX%%/etc/dnrd directory should only be user writable");
X 	cleanexit(-1);
X     }
X 
X@@ -198,31 +198,31 @@
X 
X 	if (rslt) continue;
X 	if (S_ISDIR(st.st_mode)) {
X-	    log_msg(LOG_ERR, "The /etc/dnrd directory must not contain "
X+	    log_msg(LOG_ERR, "The %%PREFIX%%/etc/dnrd directory must not contain "
X 		    "subdirectories");
X 	    cleanexit(-1);
X 	}
X 	if ((st.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH|S_IWGRP|S_IWOTH)) != 0) {
X-	    log_msg(LOG_ERR, "A file in /etc/dnrd has either execute "
X+	    log_msg(LOG_ERR, "A file in %%PREFIX%%/etc/dnrd has either execute "
X 		    "permissions or non-user write permission.  Please do a "
X 		    "\"chmod a-x,go-w\" on all files in this directory");
X 	    cleanexit(-1);
X 	}
X 	if (st.st_uid != 0) {
X-	    log_msg(LOG_ERR, "All files in /etc/dnrd must be owned by root");
X+	    log_msg(LOG_ERR, "All files in %%PREFIX%%/etc/dnrd must be owned by root");
X 	    cleanexit(-1);
X 	}
X     }
X     closedir(dirp);
X 
X-    if (chdir("/etc/dnrd")) {
X+    if (chdir("%%PREFIX%%/etc/dnrd")) {
X 	log_msg(LOG_ERR, "couldn't chdir to %s, %s",
X-		"/etc/dnrd", strerror(errno));
X+		"%%PREFIX%%/etc/dnrd", strerror(errno));
X 	cleanexit(-1);
X     }
X-    if (chroot("/etc/dnrd")) {
X+    if (chroot("%%PREFIX%%/etc/dnrd")) {
X 	log_msg(LOG_ERR, "couldn't chroot to %s, %s",
X-		"/etc/dnrd", strerror(errno));
X+		"%%PREFIX%%/etc/dnrd", strerror(errno));
X 	cleanexit(-1);
X     }
X 
END-of-dnrd/files/patch-ad
echo x - dnrd/files/patch-ae
sed 's/^X//' >dnrd/files/patch-ae << 'END-of-dnrd/files/patch-ae'
X--- query.h.orig	Sat Jan  6 14:56:49 2001
X+++ query.h	Sat Jan  6 14:56:59 2001
X@@ -25,6 +25,7 @@
X #ifndef _DNSR_QUERY_H_
X #define _DNSR_QUERY_H_
X 
X+#include <sys/types.h>
X #include <time.h>
X #include <netinet/in.h>
X 
END-of-dnrd/files/patch-ae
echo x - dnrd/files/patch-af
sed 's/^X//' >dnrd/files/patch-af << 'END-of-dnrd/files/patch-af'
X--- tcp.c.orig	Sat Jan  6 14:53:45 2001
X+++ tcp.c	Sat Jan  6 14:53:51 2001
X@@ -23,7 +23,7 @@
X #include <string.h>
X #include <unistd.h>
X #include <signal.h>
X-#include <wait.h>
X+#include <sys/wait.h>
X #include <sys/types.h>
X #include <sys/stat.h>
X #include <sys/fcntl.h>
END-of-dnrd/files/patch-af
echo x - dnrd/files/patch-ag
sed 's/^X//' >dnrd/files/patch-ag << 'END-of-dnrd/files/patch-ag'
X--- master.c.orig	Sat Jan  6 15:07:32 2001
X+++ master.c	Sat Jan  6 15:06:54 2001
X@@ -37,7 +37,7 @@
X #include "master.h"
X #include "lib.h"
X 
X-#define	MASTER_CONFIG		"/etc/dnrd/master"
X+#define	MASTER_CONFIG		"%%PREFIX%%/etc/dnrd/master"
X #define	PACKET_ASSEMBLYSIZE	600
X 
X 
END-of-dnrd/files/patch-ag
echo x - dnrd/pkg-comment
sed 's/^X//' >dnrd/pkg-comment << 'END-of-dnrd/pkg-comment'
XA proxy DNS daemon
END-of-dnrd/pkg-comment
echo x - dnrd/pkg-descr
sed 's/^X//' >dnrd/pkg-descr << 'END-of-dnrd/pkg-descr'
XDNRD is a proxy name server. To clients on your home network,
Xit looks just like a name server. In reality, it forwards every
XDNS query to the "real" DNS server, and forwards responses back
Xto the client.
X
XSo, why would you want to use it? DNRD was designed for home
Xnetworks where you might want to dial into more than one ISP
X(ie, your home ISP and a dialup connection to your office). The
Xproblem with multiple dialups is that you need to change
X/etc/resolv.conf for each one. With DNRD, this is no longer
Xnecessary.
X
XYour dialup machine will run DNRD (with appropriate options for
Xforwarding messages to the desired DNS servers). All other
Xmachines on the home network, including the dialup machine
Xitself, will use the dialup machine as its DNS server.
X
X- George Reid
Xgreid@ukug.uk.freebsd.org
END-of-dnrd/pkg-descr
echo x - dnrd/pkg-plist
sed 's/^X//' >dnrd/pkg-plist << 'END-of-dnrd/pkg-plist'
Xsbin/dnrd
END-of-dnrd/pkg-plist
exit



>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0101061525180.49343-100000>