Allow the hostname used in inform records to be overridden using a tuple in /lib/ndb/local. Reference: /n/sources/patch/applied/inform-update Date: Wed May 18 19:05:21 CES 2011 Signed-off-by: steve@auintile.net --- /sys/src/cmd/ndb/inform.c Wed May 18 19:04:40 2011 +++ /sys/src/cmd/ndb/inform.c Wed May 18 19:04:36 2011 @@ -24,11 +24,6 @@ [10] "domain name not in zone", }; -char *dnsrch[] = { - "dnsdomain", - "dom", -}; - void usage(void) { @@ -98,12 +93,12 @@ { int debug, len, fd; uint err; - char *sysname, *dnsdomain, *dom, *ns, net[32]; + char *sysname, *dnsdomain, *dom, *inform, *ns, net[32]; uchar *p, buf[4096], addr[IPv4addrlen], v6addr[IPaddrlen]; ushort txid; Ndb *db; Ndbtuple *t, *tt; - static char *query[] = { "dom", "dnsdomain", "ns", }; + static char *query[] = { "dom", "dnsdomain", "ns", "inform" }; fmtinstall('I', eipfmt); fmtinstall('V', eipfmt); @@ -112,6 +107,7 @@ debug = 0; ns = nil; dom = nil; + inform = nil; dnsdomain = nil; ARGBEGIN{ case 'd': @@ -133,16 +129,22 @@ if((db = ndbopen(nil)) == nil) sysfatal("can't open ndb: %r"); tt = ndbipinfo(db, "sys", sysname, query, nelem(query)); - for(t = tt; t; t = t->entry) + for(t = tt; t; t = t->entry){ if(strcmp(t->attr, "ns") == 0) ns = t->val; else if(strcmp(t->attr, "dom") == 0) dom = t->val; else if(strcmp(t->attr, "dnsdomain") == 0) dnsdomain = t->val; + else if(strcmp(t->attr, "inform") == 0) + inform = t->val; + } + ndbfree(tt); ndbclose(db); + if(inform) + dom = inform; if(!ns) sysfatal("no relevant ns="); if(!dom) --- /sys/man/8/ndb Wed May 18 19:04:47 2011 +++ /sys/man/8/ndb Wed May 18 19:04:42 2011 @@ -169,6 +169,8 @@ packet to a nameserver to associate the host's IPv4 address with its DNS name. This is required if the domain's nameserver is a Microsoft Windows Active Directory controller. +The host's FQDN will be sent to the AD controller unless +a tuple of the form inform=xxx is found in the hosts NDB entry. .SS "Database maintenance" .I Ndb/mkhash creates a hash file for all entries with attribute