No nameservers in R10B-0

Fredrik Thulin ft@REDACTED
Fri Oct 15 13:15:59 CEST 2004

On Friday 15 October 2004 09.12, Raimo Niskanen wrote:
> Well,
> we changed to [native,file] since we finally got a stable working
> solution on all other platforms of using the host OS resolver
> functions. That does sound as it should not be so difficult, but the
> problem was to work around multithreading issues. The [native]
> solution uses a pool of external port programs that does the actual
> resolver lookups.
> The [native] lookup option is the right(tm) way to do it since then
> all applications on the host resolves names the same way.
> The [dns] option uses an internal Erlang-only dns client that might
> behave slightly different from the one in the host OS.

Thank you for your reply. This explanation of the intent with changing 
to 'native' made seeking the culprit of the problem a lot easier =)

I agree with your reasoning about 'native' being the right way(tm) to do 

> So, I would say that you probably have a misconfigured host and
> the previous Erlang resolver options worked arount that. At least
> for IPv6.

The problem seems to be that Linux glibc (neither 2.2.5, which my server 
uses, nor 2.3.2 that my laptop has) apparently does not have 
getipnodebyname(), and inet_gethost.c does not contain any code to use 
an alternative resolving function. 

>From what I understand, getipnodebyname() is the old way to do it. Libc 
has getaddrinfo().

>From getaddrinfo(3) on FreeBSD :

>The getaddrinfo() function is defined in IEEE Std 1003.1g-2000
>(``POSIX.1''), and documented in ``Basic Socket Interface Extensions 
>for IPv6'' (RFC2553).

>From getipnodebyname(3) on FreeBSD :

>getipnodebyname() and getipnodebyaddr() do not handle scoped IPv6 
>address properly.  If you use these functions, your program will not 
>be able to handle scoped IPv6 addresses.  For IPv6 address 
>manipulation, getaddrinfo(3) and getnameinfo(3) are recommended.

Not that I think you would want to mess with scoped addresses, but 
getaddrinfo() is probably what you should use. From what I heard it is 
readily available on all modern Linux, *BSD, Solaris, HP-UX etc.

> If the nameserver does not get set now, but got set in R9C, I do
> not know why. Is that the case?

Yes, as can be seen in the erl output in my previous mail :

> > R10B-0 :
> >
> > Eshell V5.4  (abort with ^G)
> > 4> inet_db:res_option(nameserver).
> > []
> > 5>

> > R9C-0 :
> >
> > Eshell V5.3  (abort with ^G)
> > 3> inet_db:res_option(nameserver).
> > [{{130,237,162,7},53},{{130,237,200,7},53}]
> > 4>

This is the hosts /etc/resolv.conf :

$ cat /etc/resolv.conf


More information about the erlang-questions mailing list