allow the user to override the FQDN sent to the server by adding an inform=xxx line to /lib/ndb/local. solves silly problems here caused by local politics ☹ Reference: /n/sources/patch/maybe/inform-override Date: Tue Mar 30 14:17:22 CES 2010 Signed-off-by: steve@quintile.net --- /sys/src/cmd/ndb/inform.c Tue Mar 30 14:15:06 2010 +++ /sys/src/cmd/ndb/inform.c Tue Mar 30 14:15:04 2010 @@ -31,11 +31,6 @@ [10] "domain name not in zone", }; -char *dnsrch[] = { - "dnsdomain", - "dom", -}; - void usage(void) { @@ -105,12 +100,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); @@ -119,6 +114,7 @@ debug = 0; ns = nil; dom = nil; + inform = nil; dnsdomain = nil; ARGBEGIN{ case 'd': @@ -140,16 +136,21 @@ 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 Tue Mar 30 14:15:10 2010 +++ /sys/man/8/ndb Tue Mar 30 14:15:08 2010 @@ -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 hosts FQDN is normally sent to the AD controller but this may +be overridden using the inform=xxx tuple in the hosts NDB entry. .SS "Database maintenance" .I Ndb/mkhash creates a hash file for all entries with attribute