5 rmtdns(char *net, char *path)
9 char *domain, *cp, buf[1024];
11 if(net == 0 || path == 0)
14 domain = strdup(path);
15 cp = strchr(domain, '!');
22 if(*domain == '[' && domain[n-1] == ']'){ /* accept [nnn.nnn.nnn.nnn] */
24 r = strcmp(ipattr(domain+1), "ip");
27 r = strcmp(ipattr(domain), "ip"); /* accept nnn.nnn.nnn.nnn */
34 snprint(buf, sizeof(buf), "%s/dns", net);
36 fd = open(buf, ORDWR); /* look up all others */
37 if(fd < 0){ /* dns screw up - can't check */
42 n = snprint(buf, sizeof(buf), "%s all", domain);
45 n = write(fd, buf, n);
48 rerrstr(buf, sizeof(buf));
49 if (strcmp(buf, "dns: name does not exist") == 0)
56 void main(int, char *argv[]){ print("return = %d\n", rmtdns("/net.alt/tcp/109", argv[1]));}