fprintf(stderr, "Usage: host [-w] [-v] [-r] [-d] [-t querytype] [-c class] [-a] host [server]\n -w to wait forever until reply\n -v for verbose output\n -r to disable recursive processing\n -d to turn on debugging output\n -t querytype to look for a specific type of information\n -c class to look for non-Internet data\n -a is equivalent to '-v -t *'\n");
exit(1);
}
while (c > 2 && v[1][0] == '-') {
if (strcmp (v[1], "-w") == 0) {
_res.retry = 1;
_res.retrans = 15;
waitmode = 1;
v++;
c--;
}
else if (strcmp (v[1], "-r") == 0) {
_res.options &= ~RES_RECURSE;
v++;
c--;
}
else if (strcmp (v[1], "-d") == 0) {
_res.options |= RES_DEBUG;
v++;
c--;
}
else if (strcmp (v[1], "-v") == 0) {
verbose = 1;
v++;
c--;
}
else if (strcmp (v[1], "-l") == 0) {
list = 1;
v++;
c--;
}
else if (strncmp (v[1], "-t", 2) == 0) {
v++;
c--;
gettype = parsetype(v[1]);
v++;
c--;
}
else if (strncmp (v[1], "-c", 2) == 0) {
v++;
c--;
getclass = parseclass(v[1]);
v++;
c--;
}
else if (strcmp (v[1], "-a") == 0) {
verbose = 1;
gettype = T_ANY;
v++;
c--;
}
}
if (c > 2) {
s = v[2];
server_specified++;
if (!inet_aton(s, (struct in_addr *)&addr)) {
hp = gethostbyname(s);
if (hp == NULL) {
fprintf(stderr,"Error in looking up server name:\n");