nsd 3.0.2 complains if no -a and no ip-address:

Hello,

It's on my way of trial on NSD 3.0.2.

When I invoke nsd without -a option and no 'ip-address:'
entry on nsd.conf, it complains like

  ingram2# /proj/nsd-3.0.2/sbin/nsd -t /proj/nsd3
  [1164349528] nsd[69777]: error: cannot parse address '(null)'

But nsd.conf.5 says...

  ip-address: <ip4 or ip6>
  ....If none are given NSD lis-
  tens to all IP addresses. Same as commandline option -a.

Both giving -a 0.0.0.0 and giving 'ip-address: 0.0.0.0'
work fine.

ingram2# /proj/nsd-3.0.2/sbin/nsd -t /proj/nsd3 -a 0.0.0.0
ingram2# netstat -af inet | grep \\.domain
tcp4 0 0 *.domain *.* LISTEN
udp4 0 0 *.domain *.*

I observed this case on FreeBSD 6.1.

ingram2# uname -rs
FreeBSD 6.1-RELEASE-p10

I don't understand the behabior of getaddrinfo(NULL, ...),
{shortage of the background knowledge causes it}, the
problem may be around there, I guess.

Any fault on me?

Thanks

            Koh-ichi Ito
        Internet Research Institute, Inc.

# I resend this mail because it seems to be lost.
# Excuse me if it is duplicated.

Hello,

It's on my way of trial on NSD 3.0.2.

When I invoke nsd without -a option and no 'ip-address:'
entry on nsd.conf, it complains like

  ingram2# /proj/nsd-3.0.2/sbin/nsd -t /proj/nsd3
  [1164349528] nsd[69777]: error: cannot parse address '(null)'

But nsd.conf.5 says...

  ip-address: <ip4 or ip6>
  ....If none are given NSD lis-
  tens to all IP addresses. Same as commandline option -a.

Both giving -a 0.0.0.0 and giving 'ip-address: 0.0.0.0'
work fine.

ingram2# /proj/nsd-3.0.2/sbin/nsd -t /proj/nsd3 -a 0.0.0.0
ingram2# netstat -af inet | grep \\.domain
tcp4 0 0 *.domain *.* LISTEN
udp4 0 0 *.domain *.*

I observed this case on FreeBSD 6.1.

ingram2# uname -rs
FreeBSD 6.1-RELEASE-p10

I don't understand the behabior of getaddrinfo(NULL, ...),
{shortage of the background knowledge causes it}, the
problem may be around there, I guess.

Any fault on me?

Thanks

            Koh-ichi Ito
        Internet Research Institute, Inc.

Koh-ichi Ito wrote:

Hello,

It's on my way of trial on NSD 3.0.2.

When I invoke nsd without -a option and no 'ip-address:'
entry on nsd.conf, it complains like

  ingram2# /proj/nsd-3.0.2/sbin/nsd -t /proj/nsd3
  [1164349528] nsd[69777]: error: cannot parse address '(null)'

But nsd.conf.5 says...

  ip-address: <ip4 or ip6>
  ....If none are given NSD lis-
  tens to all IP addresses. Same as commandline option -a.

Both giving -a 0.0.0.0 and giving 'ip-address: 0.0.0.0'
work fine.

ingram2# /proj/nsd-3.0.2/sbin/nsd -t /proj/nsd3 -a 0.0.0.0
ingram2# netstat -af inet | grep \\.domain
tcp4 0 0 *.domain *.* LISTEN
udp4 0 0 *.domain *.*

I observed this case on FreeBSD 6.1.

ingram2# uname -rs
FreeBSD 6.1-RELEASE-p10

I don't understand the behabior of getaddrinfo(NULL, ...),
{shortage of the background knowledge causes it}, the
problem may be around there, I guess.

Any fault on me?

Hi Koh-ichi,

I think you are looking at the wrong error message. It seems that NSD
ignores the error code returned by getaddrinfo. Something else is going
wrong.

getaddrinfo works fine with node=NULL and service="53". This works on my
FreeBSD 6.1 test server. I think you are having some other error. Below
is a change to nsd.c that prints the error in more detail. Could you use
this and see what is really going on?

Thanks for the report - I'll fix the error message to be more
descriptive for upcoming NSD 3.0.3 and 2.3.7.

Best regards,
   Wouter

Index: nsd.c

Hello,

Thanks for your response.

> When I invoke nsd without -a option and no 'ip-address:'
> entry on nsd.conf, it complains like
>
> ingram2# /proj/nsd-3.0.2/sbin/nsd -t /proj/nsd3
> [1164349528] nsd[69777]: error: cannot parse address '(null)'

getaddrinfo works fine with node=NULL and service="53". This works on my
FreeBSD 6.1 test server. I think you are having some other error. Below
is a change to nsd.c that prints the error in more detail. Could you use
this and see what is really going on?

Here it is.

ingram2# /proj/nsd-3.0.2/sbin/nsdc start
[1164788497] nsd[97639]: error: cannot parse address '(null)': getaddrinfo: Address family for hostname not supported

BTW, I have no experience of using subversion. How can I
apply this patch? my 'patch' is

kohi@ingram2[4]% patch --version
Patch version 2.1

And I did it by hand this time.

Thanks

            Koh-ichi Ito
        Internet Research Institute, Inc.

Koh-ichi Ito wrote:

Here it is.

ingram2# /proj/nsd-3.0.2/sbin/nsdc start
[1164788497] nsd[97639]: error: cannot parse address '(null)': getaddrinfo: Address family for hostname not supported

Oh. What happens is that NSD tries to open by default a ip4 and ip6
socket. And the ip6 is not supported.

On linux/solaris, the getaddrinfo works, but socket creation fails if no
ip6 is configured for an interface.

Your version will work using the -4 option or ip4-only: yes

The patch below should provide automatic fallback to ip4 for you. Could
you test this too and tell me if that provides a working fallback for you?

Best regards,
   Wouter

BTW, I have no experience of using subversion. How can I
apply this patch? my 'patch' is

kohi@ingram2[4]% patch --version
Patch version 2.1

And I did it by hand this time.

Use patch -p0 < patchfile

Index: nsd.c

> Here it is.
>
> ingram2# /proj/nsd-3.0.2/sbin/nsdc start
> [1164788497] nsd[97639]: error: cannot parse address '(null)': getaddrinfo: Address family for hostname not supported

Oops!

Excuse me, because I applied previous patch by hand, so the
nest of parentheses was incorrect, and I correct it now.

Actual message is the following.

ingram2# /pub/src/nsd/nsd-3.0.2-local/nsd -t /proj/nsd3
[1164854165] nsd[5156]: error: cannot parse address '(null)': getaddrinfo: hostname nor servname provided, or not known

Your version will work using the -4 option or ip4-only: yes

I tried -4, it works fine, but this may be out of point
because I got EAI_NONAME, not EAI_FAMILY actually.

I wonder these help or not,
- options INET6 is excluded from my KERNCONF.
- I didn't apply --disable-ipv6 on configure.

Use patch -p0 < patchfile

s/^- -/-/ makes it fine.

Regards,

            Koh-ichi Ito
        Internet Research Institute, Inc.

Hi Koh-ichi,

Thank you for helping me solve this. I've cornered it and it should be
fixed in the next release (3.0.3).

Best regards,
   Wouter

Koh-ichi Ito wrote:

Hello,

It's on my way of trial on NSD 3.0.2.

When I invoke nsd without -a option and no 'ip-address:'
entry on nsd.conf, it complains like

  ingram2# /proj/nsd-3.0.2/sbin/nsd -t /proj/nsd3
  [1164349528] nsd[69777]: error: cannot parse address '(null)'

Let me just inform you, I tried this case with NSD
3.0.3. Though it brings the following warning, it seems to
work fine.

ingram2# /proj/nsd-3.0.3/sbin/nsd -t /proj/nsd3
[1165811294] nsd[18479]: warning: No IPv6, fallback to IPv4. getaddrinfo: hostname nor servname provided, or not known

Thanks

            Koh-ichi Ito
        Internet Research Institute, Inc.

Koh-ichi Ito wrote:

Hello,

It's on my way of trial on NSD 3.0.2.

When I invoke nsd without -a option and no 'ip-address:'
entry on nsd.conf, it complains like

  ingram2# /proj/nsd-3.0.2/sbin/nsd -t /proj/nsd3
  [1164349528] nsd[69777]: error: cannot parse address '(null)'

Let me just inform you, I tried this case with NSD
3.0.3. Though it brings the following warning, it seems to
work fine.

ingram2# /proj/nsd-3.0.3/sbin/nsd -t /proj/nsd3
[1165811294] nsd[18479]: warning: No IPv6, fallback to IPv4. getaddrinfo: hostname nor servname provided, or not known

Thanks

No problem.

The reason I put in the warning, is that I want to provide the error
message from getaddrinfo to the user. And inform about the fallback
action that is taken. So that an operator that receives a legitimate
error (but only on IP6) will be able to track the source of his problems.

Best regards,
   Wouter