Like a lot of folks, I have dnrd running as the DNS server for my home
local lan on a demand dial connection. This connection is ISDN in my
case and therefore costs me bukcs per minute (Thank you Verizon!).
Since the windoze machines on my network insist on doing nameserver
lookups for shortnames, dnrd was dial out every 15 minutes to do a
lookup for a host in my master file. For example:
gateway.localdomain (dns proxy machine, dial on demand
masquerading ISDN connection machine,
fileserver, etc.)
me.localdomain (my windoze desktop)
her.localdomain (my wife's windoze desktop)
etc.
Both me.localdomain & her.localdomain use gateway.localdomain as their
DNS server.
So, every 15 minutes, 'me' or 'her' do a dns lookup for 'gateway'.
JUST 'gateway'. While gateway.localdomain in in my /etc/dnrd/master
file, 'gateway' is not and so the link is brought up, earthlink's DNS
servers reply "Huh? We know nothing about this 'gateway' creature" and
the lookup fails.
Costs me 1 minute of uptime ($0.02) every 15 minutes (4 times/hour, 96
times /day, 2880 times a month) = $57 a month. Ouch. Assuming it
doesn't take longer than 1 minute of billable time.
So I wrote the incredibly complex patch attached here, which basically
says that for a hostname entry in the /etc/dnrd/master file, if it
ENDS with a period, delete the period and store the record as is. This
let me write my /etc/dnrd/master like this:
domain localdomain +auth
192.168.0.1 gateway.localdomain gateway.
192.168.0.10 me.localdomain me.
192.168.0.11 her.localdomain her.
with the second entries ensuring that Dnrd knows even about the short
names for my localhosts.
A better solution for these shortnames would be to have dnrd try all
the domains which it is authoritative for in turn, appending the
domain to the shortnames.
------------- cut here -------------------------
diff -ur dnrd-2.10/src/master.c dnrd-2.10-chris/src/master.c
--- dnrd-2.10/src/master.c Fri Jan 19 15:32:31 2001
+++ dnrd-2.10-chris/src/master.c Mon Oct 29 12:37:30 2001
@@ -290,6 +290,11 @@
word[len-1] = 0;
snprintf (name, size, "%s%s%s", word, domain[0] ? "." : "",
domain);
}
+ else if ((len = strlen(word)) > 0 && word[len-1] == '.') {
+ word[len-1] = 0;
+ size--;
+ copy_string(name, word, size);
+ }
else if (strchr(word, '.') == NULL) {
snprintf (name, size, "%s%s%s", word, domain[0] ? "." : "",
domain);
}