This is the mail archive of the
mailing list for the glibc project.
netresolve: name resolution library project announcement
- From: Pavel Simerda <psimerda at redhat dot com>
- To: libc-alpha <libc-alpha at sourceware dot org>
- Date: Fri, 8 Nov 2013 16:08:47 -0500 (EST)
- Subject: netresolve: name resolution library project announcement
- Authentication-results: sourceware.org; auth=none
I would like to announce a new project called *netresolve* I started at sourceware.org. All started with a regression I experienced when using `ssh` to connect to a literal IPv6 link-local address caused by a Fedora patch to glibc. I wanted to know more about the original problem they were trying to solve and after some testing and source reading I found numerous bugs and limitations in the glibc network name resolution stack.
Many of the issues can be found using the following query:
Originally, I was going to prepare and submit patches for glibc and I indeed attached some to the bugzilla. But finally I realized some behavioral details are not settled so well and they need quite some documentation and discussion. Also I wanted to experiment with features that cannot be expressed in terms of `getaddrinfo()` or similar API or that are not possible with the current name service switch backend API which is even more restricted.
The result of that is a proof of concept implementation of a nonblocking (aka asynchronous) name resolution library with backends, which serves as an alternative to glibc's `getaddrinfo()` API.
Following libraries and tools are provided:
* `netresolve` command line tool
* `libnetresolve.so` name resolution library
* `libnetresolve-getaddrinfo.so` provides `getaddrinfo()` API on top of netresolve
* `tools/wrapper.sh` script to `LD_PRELOAD` the alternative getaddrinfo implementation
Current name resolution power is provided by the following backends:
* any: handles translation of NULL or empty names to `0.0.0.0` and/or `::` unless configured for `connect()`
* loopback: translates `localhost`, `localhost4`, `localhost6` and NULL/empty node names to `127.0.0.1` and/or `::1`
* numerichost: handles numeric values including ifindex/scope_id percent sign notation
* hosts: answers using data from /etc/hosts
* dns: uses c-ares to perform DNS queries
* unix: handles AF_UNIX paths
Following backends help with testing netresolve as well as glibc:
* getaddrinfo: uses `getaddrinfo()` for name resolution
* nss: uses a specified glibc nsswitch backend for name resolution
* exec: performs name resolution by consulting an executable via stdin and stdout
* socket API to provide a common implementation of bind/connect after name resolution
* extended information (like TTL, DNSSEC validation, etc.)
* sensible dualstack networking (Happy Eyeballs and stuff like that)
* name service switch backend on top of netresolve
* SRV and MX record support
* multicast DNS backend
* AI_ADDRCONFIG-like functionality
* wrappers for glib, python and others
The primary goal of the library is to provide name resolution functionality for network applications without the limitations currently imposed by the glibc implementation. For now I'm going to develop netresolve alongside glibc's name resolution functionality but would also like to see what can be done with the glibc implementation itself. That is why I started the project at sourceware.org and why I'm announcing it on the glibc mailing list. Looking forward to working together to make name resolution on open source systems better.
More information about netresolve:
The source code:
File bug reports and feature requests: