On Sun, 1 Feb 2015 15:06:17 -0800
"Pawel S. Veselov" <pawel.vese...@gmail.com> wrote:

> Running latest amd64 5.6 (p16, just upgraded to it), for some reason
> my nslookup keeps trying to use port 48830 to connect to the NS
> server. gethostbyname() works just fine, all the apps resolve the
> hostnames just fine, but host/dig/nslookup don't.

Of course, the problem was typo in 'nameservers' line
in /etc/resolv.conf. If there are no name servers, dig tools use
internal default, but don't set up the port number, so uninitialized
memory is used. This patch should take care of it, looks like it's the
right place for this.

# diff -up dighost.c.old dighost.c
--- dighost.c.old       Sun Feb  1 21:25:31 2015
+++ dighost.c   Sun Feb  1 21:26:39 2015
@@ -645,10 +645,12 @@ add_nameserver
                confdata->nameservers[i].family = LWRES_ADDRTYPE_V4;
                confdata->nameservers[i].length = NS_INADDRSZ;
+                confdata->nameserverports[i] = NAMESERVER_PORT;
                break;
        case AF_INET6:
                confdata->nameservers[i].family = LWRES_ADDRTYPE_V6;
                confdata->nameservers[i].length = NS_IN6ADDRSZ;
+                confdata->nameserverports[i] = NAMESERVER_PORT;
                break;
        default:
                return (ISC_R_FAILURE);


[skipped]

Reply via email to