Patch for DNS over IPv6 support

View: New views
2 Messages — Rating Filter:   Alert me  

Patch for DNS over IPv6 support

by Sergei Golovan-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi!

Appears that Erlang doesn't use DNS servers over IPv6. It ignores
nameserver directive in /etc/resolv.conf if the IP it specifies is an
IPv6 address and directly uses inet_udp and inet_tcp when connecting
to DNS server (module inet_res).

The problem is that if for some reason /etc/resolv.conf doesn't
contain IPv4 nameservers the Erlang resolver doesn't work (see bug
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=539269 in Debian
bugtracker). This situation isn't common now, but will be more and
more common in the future.

The attached patch adds transparent IPv6 support to inet_res module.
It means that in case when nameserver IP address is an IPv4 address
then it will be queried over IPv4, if it is an IPv6 address then it
will be queried over IPv6. There is one drawback though: in case of
DNS over UDP instead of opening a single socket and using it for
queries to all nameservers the patched version opens one socket per
DNS query. This may slightly decrease performance in case of many DNS
servers in /etc/resolv.conf.

Cheers!
--
Sergei Golovan



________________________________________________________________
erlang-patches mailing list. See http://www.erlang.org/faq.html
erlang-patches (at) erlang.org

Re: Patch for DNS over IPv6 support

by Sergei Golovan-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Seems like the mailing list gobbled the attachment. It is also
attached to a message in Debian bugreport:
http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=50;filename=resolver_ipv6.diff;att=1;bug=539269

On Sat, Aug 1, 2009 at 5:35 PM, Sergei Golovan<sgolovan@...> wrote:

> Hi!
>
> Appears that Erlang doesn't use DNS servers over IPv6. It ignores
> nameserver directive in /etc/resolv.conf if the IP it specifies is an
> IPv6 address and directly uses inet_udp and inet_tcp when connecting
> to DNS server (module inet_res).
>
> The problem is that if for some reason /etc/resolv.conf doesn't
> contain IPv4 nameservers the Erlang resolver doesn't work (see bug
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=539269 in Debian
> bugtracker). This situation isn't common now, but will be more and
> more common in the future.
>
> The attached patch adds transparent IPv6 support to inet_res module.
> It means that in case when nameserver IP address is an IPv4 address
> then it will be queried over IPv4, if it is an IPv6 address then it
> will be queried over IPv6. There is one drawback though: in case of
> DNS over UDP instead of opening a single socket and using it for
> queries to all nameservers the patched version opens one socket per
> DNS query. This may slightly decrease performance in case of many DNS
> servers in /etc/resolv.conf.
>
> Cheers!
> --
> Sergei Golovan
>



--
Sergei Golovan

________________________________________________________________
erlang-patches mailing list. See http://www.erlang.org/faq.html
erlang-patches (at) erlang.org