Commit Diff
Diff:
0f65e2eeba3dd0b2a9b54caff92d8469e0c31921
0aefb92aa7408020050366d736d6787c07b3968d
Commit:
0aefb92aa7408020050366d736d6787c07b3968d
Tree:
7ee08f7fc63a51a8857a466c10a282ffb99f8fc5
Author:
pbug <pbug@delphinusdns.org>
Committer:
pbug <pbug@delphinusdns.org>
Date:
Tue Apr 12 09:32:31 2011 UTC
Message:
* update README on what it can't do and what would be nice to have * update main.c for including a pid file, this is work in progress I just want to get this out quick. * fix example files
blob - 74d37615759c71dfa38fc65fe20264ba993fcc1f
blob + 96cc437a5e15237a1313d9ccd02edcfe32f7e7ac
--- README
+++ README
@@ -1,4 +1,4 @@
-$Id: README,v 1.17 2010/09/15 14:05:08 pbug Exp $
+$Id: README,v 1.18 2011/04/12 09:32:31 pbug Exp $
1. README
2. WHY WILDCARDNS?
@@ -88,9 +88,40 @@ in the directory "examples" are a few examples from wo
6. WHAT IT CAN'T DO
-------------------
-A lot it can't do.
-[stay tuned]
+* CNAME recursion. When you look up www.yahoo.com you see this:
+;; ANSWER SECTION:
+www.yahoo.com. 58 IN CNAME fp.wg1.b.yahoo.com.
+fp.wg1.b.yahoo.com. 2802 IN CNAME eu-fp.wa1.b.yahoo.com.
+eu-fp.wa1.b.yahoo.com. 8 IN A 87.248.122.122
+eu-fp.wa1.b.yahoo.com. 8 IN A 87.248.112.181
+
+The recursive part of wildcarddnsd isn't able to recurse CNAME's and it
+also doesn't have loop detection of CNAME's. This means that some lookups
+will fail on a UNIX host using wildcarddnsd recursively, so it's useless
+this needs fixing and the fix isn't simple.
+
+* AXFR. (RFC 5936) In order to have a heterogenous network made up of
+wildcardddnsd as the master and (say bind9 as) other slaves and AXFR would
+be needed. Since wildcarddnsd's zone database is flat meaning there is
+really no such things as zones making an easy AXFR work is finally not so
+easy.
+
+* DNSSEC. Signed zones are becoming more and more common on the Internet.
+Wildcarddnsd can't do DNSSEC yet, unfortunately.
+
+* Solaris. Unless you port some functions to solaris it won't compile on
+there.
+
+* Recursive nameserver. The recursive nameserver is broken. It will work for
+a little bit perhaps and then out of nowhere will try to flood some poor
+nameserver. There is a safety catch from that happening but it kills the
+server. This part will likely need to be rewritten and I don't have the
+time to do that. The design is weak and I made it work with little planning.
+So in wildcarddnsd beta 6 the functionality for recursivenes is there but
+it doesn't work consistently.
+
+
7. WARNING
----------
@@ -106,3 +137,5 @@ Warning: WildcardDNS is research material and could ca
the Internet. Understand the licensing if you plan to use it despite, I'm
not liable and you've been warned.
+Try not to use the recursive nameserver as released with BETA 6. It doesn't
+work.
blob - 44ad801e7d2710bde90635c3499a8a7f700b6647
blob + 6c1298247fa0b149fbb74ef90fe65b0d14a810b1
--- example2.conf
+++ example2.conf
@@ -6,13 +6,6 @@
version "4";
-
-# wildcarddns - RR configuration file
-#
-#
-
-version "3";
-
; WARNING - the way wildcarddnsd originally implemented wildcarding is
; wrong and can cause damage on the Internet (DoS), it can
; also cause damage on someone using wildcarding, so it's best
@@ -105,6 +98,6 @@ zone "default" {
; cvs
cvs.solarscale.de,cname,3600,miranda.solarscale.de.
; irc
- irc.solarscale.de,cnam,3600,ariel.solarscale.de.
+ irc.solarscale.de,cname,3600,ariel.solarscale.de.
}
; end
blob - 8f6c0f56e7a18bfb7a044b357cdb0dc5a92c4568
blob + 257f1e15748cd3d1bb9e6da15539e23917632e83
--- main.c
+++ main.c
@@ -65,10 +65,13 @@ int memcasecmp(u_char *, u_char *, int);
char * get_dns_type(int dnstype);
void build_reply(struct sreply *reply, int so, char *buf, int len, struct question *q, struct sockaddr *sa, socklen_t slen, struct domain *sd1, struct domain *sd2, u_int8_t region, int istcp, int wildcard, struct recurses *sr);
void recurseheader(struct srecurseheader *, int, struct sockaddr_storage *, struct sockaddr_storage *, int);
+void setup_master(int);
+void master_shutdown(int);
/* aliases */
#define DEFAULT_PRIVILEGE "named"
#define DEFAULT_SOCKET 64
+#define PIDFILE "/var/run/wildcarddnsd.pid"
struct typetable {
@@ -114,7 +117,7 @@ struct tcps {
} *tn1, *tn2, *tnp;
-static const char rcsid[] = "$Id: main.c,v 1.60 2011/02/27 19:04:52 pbug Exp $";
+static const char rcsid[] = "$Id: main.c,v 1.61 2011/04/12 09:32:31 pbug Exp $";
/*
* MAIN - set up arguments, set up database, set up sockets, call mainloop
@@ -209,6 +212,23 @@ main(int argc, char *argv[])
openlog(__progname, LOG_PID | LOG_NDELAY, LOG_DAEMON);
syslog(LOG_INFO, "starting up");
+
+ /* make a master program that holds the pidfile, boss of ... eek */
+
+ pid = fork();
+ switch (pid) {
+ case -1:
+ syslog(LOG_ERR, "fork(): %m");
+ exit(1);
+ case 0:
+ break;
+ default:
+ setup_master(port);
+ /* NOTREACHED */
+ exit(1);
+ }
+
+
#if DB_VERSION_MAJOR == 4
if (db_create((DB **)&db, (DB_ENV *)NULL, 0) != 0) {
@@ -2583,4 +2603,49 @@ recurseheader(struct srecurseheader *rh, int proto, st
return;
+}
+
+void
+setup_master(int port)
+{
+ char buf[512];
+ pid_t pid;
+ int fd;
+
+ setproctitle("wildcarddnsd master on port %u", port);
+
+ fd = open(PIDFILE, O_WRONLY | O_APPEND | O_CREAT, 0644);
+ if (fd < 0) {
+ syslog(LOG_ERR, "couldn't install pid file, exiting...\n");
+ pid = getpgrp();
+ killpg(pid, SIGTERM);
+ exit(1);
+ }
+
+ pid = getpid();
+ snprintf(buf, sizeof(buf), "%u\n", pid);
+
+ write(fd, buf, strlen(buf));
+ close(fd);
+
+ signal(SIGTERM, master_shutdown);
+
+ for (;;) {
+ sleep(10);
+ }
+
+ /* NOTREACHED */
+}
+
+void
+master_shutdown(int sig)
+{
+ pid_t pid;
+
+ unlink(PIDFILE);
+
+ pid = getpgrp();
+ killpg(pid, SIGTERM);
+
+ exit(0);
}
repomaster@centroid.eu