-.\" $OpenBSD: rebound.8,v 1.9 2018/01/12 04:36:45 deraadt Exp $
+.\" $OpenBSD: rebound.8,v 1.10 2018/02/07 01:02:46 tedu Exp $
.\"
.\"Copyright (c) 2015 Ted Unangst <tedu@openbsd.org>
.\"
.\"WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\"ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\"OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-.Dd $Mdocdate: January 12 2018 $
+.Dd $Mdocdate: February 7 2018 $
.Dt REBOUND 8
.Os
.Sh NAME
.Sh DESCRIPTION
The
.Nm
-daemon proxies DNS requests.
+daemon proxies and caches DNS requests.
It listens by default on localhost and forwards queries to another server.
.Pp
-When
-.Nm
-starts, it sets the
-.Dv kern.dnsjackport
-.Xr sysctl 2
-which enables it to intercept all DNS traffic.
-.Pp
If sent a
.Dv SIGUSR1
signal,
-/* $OpenBSD: rebound.c,v 1.92 2018/02/06 20:38:47 tedu Exp $ */
+/* $OpenBSD: rebound.c,v 1.93 2018/02/07 01:02:46 tedu Exp $ */
/*
* Copyright (c) 2015 Ted Unangst <tedu@openbsd.org>
*
return 1;
}
-static void
-resetport(void)
-{
- int dnsjacking[2] = { CTL_KERN, KERN_DNSJACKPORT };
- int jackport = 0;
-
- sysctl(dnsjacking, 2, NULL, NULL, &jackport, sizeof(jackport));
-}
-
static void __dead
usage(void)
{
int
main(int argc, char **argv)
{
- int dnsjacking[2] = { CTL_KERN, KERN_DNSJACKPORT };
- int jackport = 54;
union sockun bindaddr;
int ld, ld6, ud, ud6, ch;
int one = 1;
break;
case 'l':
bindname = optarg;
- jackport = 0;
break;
case 'W':
daemonized = 1;
memset(&bindaddr, 0, sizeof(bindaddr));
bindaddr.i.sin_len = sizeof(bindaddr.i);
bindaddr.i.sin_family = AF_INET;
- bindaddr.i.sin_port = htons(jackport ? jackport : 53);
+ bindaddr.i.sin_port = htons(53);
inet_aton(bindname, &bindaddr.i.sin_addr);
ud = socket(AF_INET, SOCK_DGRAM, 0);
memset(&bindaddr, 0, sizeof(bindaddr));
bindaddr.i6.sin6_len = sizeof(bindaddr.i6);
bindaddr.i6.sin6_family = AF_INET6;
- bindaddr.i6.sin6_port = htons(jackport ? jackport : 53);
+ bindaddr.i6.sin6_port = htons(53);
bindaddr.i6.sin6_addr = in6addr_loopback;
ud6 = socket(AF_INET6, SOCK_DGRAM, 0);
if (listen(ld6, 10) == -1)
logerr("listen: %s", strerror(errno));
- if (jackport) {
- atexit(resetport);
- sysctl(dnsjacking, 2, NULL, NULL, &jackport, sizeof(jackport));
- }
-
if (debug) {
int conffd = openconfig(confname, -1);
return workerloop(conffd, ud, ld, ud6, ld6);