small improvements.

git-svn-id: file:///svn/unbound/trunk@816 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2007-12-07 11:01:04 +00:00
parent abf85e9270
commit 5a198e0b4c
2 changed files with 11 additions and 3 deletions

View file

@ -2,6 +2,8 @@
- unbound-host has a -d option to show what happens. This can help - unbound-host has a -d option to show what happens. This can help
with debugging (why do I get this answer). with debugging (why do I get this answer).
- fixup CNAME handling, on nodata, sets and display canonname. - fixup CNAME handling, on nodata, sets and display canonname.
- dot removed from CNAME display.
- respect -v for NXDOMAINs.
6 December 2007: Wouter 6 December 2007: Wouter
- library resolution works in foreground mode, unbound-host app - library resolution works in foreground mode, unbound-host app

View file

@ -52,7 +52,7 @@ static void
usage() usage()
{ {
printf("Usage: unbound-host [-vdh] [-c class] [-t type] hostname\n"); printf("Usage: unbound-host [-vdh] [-c class] [-t type] hostname\n");
printf(" [-y key] [-f keyfile] [-F named.conf]\n"); printf(" [-y key] [-f keyfile] [-F namedkeyfile]\n");
printf(" Queries the DNS for information.\n"); printf(" Queries the DNS for information.\n");
printf(" The hostname is looked up for IP4, IP6 and mail.\n"); printf(" The hostname is looked up for IP4, IP6 and mail.\n");
printf(" If an ip-address is given a reverse lookup is done.\n"); printf(" If an ip-address is given a reverse lookup is done.\n");
@ -283,8 +283,11 @@ pretty_output(char* q, int t, int c, int sec, int haved,
pretty_rcode(rcodestr, 16, result->rcode); pretty_rcode(rcodestr, 16, result->rcode);
if(!haved && result->rcode) { if(!haved && result->rcode) {
printf("Host %s not found: %d(%s). %s\n", printf("Host %s not found: %d(%s).",
q, result->rcode, rcodestr, secstatus); q, result->rcode, rcodestr);
if(verb > 0)
printf(" %s", secstatus);
printf("\n");
return; return;
} }
if(docname && result->canonname && if(docname && result->canonname &&
@ -295,6 +298,9 @@ pretty_output(char* q, int t, int c, int sec, int haved,
printf(" %s", secstatus); printf(" %s", secstatus);
printf("\n"); printf("\n");
} }
/* remove trailing . from long canonnames for nicer output */
if(result->canonname && strlen(result->canonname) > 1)
result->canonname[strlen(result->canonname)-1] = 0;
if(!haved) { if(!haved) {
if(verb > 0) { if(verb > 0) {
printf("%s", result->canonname?result->canonname:q); printf("%s", result->canonname?result->canonname:q);