Code Monkey home page Code Monkey logo

getdns's Introduction

getdns

Overview of getdns

getdns is an implementation of a modern asynchronous DNS API; the specification was originally edited by Paul Hoffman. It is intended to make all types of DNS information easily available to application developers and non-DNS experts.

Why you might want getdns

Traditional access to DNS data from applications has several limitations:

  • APIs require applications to have considerable sophistication about DNS data and data types

  • Some kinds of data about the response (notably, the resource record set time to live) is not exposed via any API, so applications need to process raw protocol responses to get such data

  • APIs are often blocking, meaning asynchronous access is not possible without some work

  • Sophisticated uses of the DNS (things like IDNA and DNSSEC validation) require considerable application work, possibly by application developers with little experience with the vagaries of DNS.

getdns also provides an experimental DNS Privacy enabled client called 'stubby' - see below for more details.

Motivation for providing the API

The developers are of the opinion that DNSSEC offers a unique global infrastructure for establishing and enhancing cryptographic trust relations. With the development of this API we intend to offer application developers a modern and flexible interface that enables end-to-end trust in the DNS architecture, and which will inspire application developers to implement innovative security solutions in their applications.

API Documentation

Note that this implementation offers additional functionality to supplement that in the official getdns API. Some additions are convenient utility functions but other functionality is experimental prior to be being recommended for inclusion in the official API. The Doxygen documentation provides the details of the full API for this implementation.

License

This implementation is licensed under the New BSD License (BSD-new).

Obtaining and getting started with getdns

The project home page at getdnsapi.net provides documentation, binary downloads, and news regarding the getdns API implementation. This README file captures the goals and direction of the project and the current state of the implementation.

If you are just getting started with the library take a look at the section below that describes building and handling external dependencies for the library.

Examples

Once it is built you should take a look at spec/example to see how the library is used.

Download

Download the sources from our github repo or from getdnsapi.net and verify the download using the checksums (SHA1 or MD5) or using gpg to verify the signature. Our keys are available from the openpgp keyserver

Releases

Release numbering follows the Semantic Versioning approach. The code is currently under active development.

The following requirements were met as conditions for the present release:

  • code compiles cleanly on at least the primary target platforms: OSX, Linux (RHEL/CentOS, Ubuntu), FreeBSD
  • examples must compile and run cleanly
  • there must be clear documentation of supported and unsupported elements of the API

External Dependencies

If you are installing from packages, you have to install the library and also the library-devel (or -dev) for your package management system to get the the necessary compile time files.

External dependencies are linked outside the getdns API build tree (we rely on CMake to find them). We would like to keep the dependency tree short, see Minimising Dependancies for more details.

Required for all builds:

Required for all builds that include recursive functionality:

Required for all builds that include IDN functionality:

Required to build the documentation:

  • Doxygen is used to generate documentation; while this is not technically necessary for the build it makes things a lot more pleasant.

For example, to build on Ubuntu 18.04 or later, you would need the following packages for a full build:

# apt install build-essential libunbound-dev libidn2-dev libssl-dev cmake

Building

If you are building from git, you need to do the following before building:

# git submodule update --init

From release 1.6.0 getdns uses CMake (previous versions used autoconf/libtool). To build from this release and later use:

# cmake .
# make

If you are unfamiliar with CMake, see our CMake Quick Start for how to use CMake options to customise the getdns build.

As well as building the getdns library two other tools are installed by default:

  • getdns_query: a command line test script wrapper for getdns. This can be used to quickly check the functionality of the library, see (#using-getdnsquery)
  • getdns_server_mon: test DNS server function and capabilities

Additionally Stubby a DNS Privacy enabled client can also be built and installed by using the BUILD_STUBBY option when running cmake, see Stubby.

Minimizing dependencies

  • getdns can be configured for stub resolution mode only with the ENABLE_STUB_ONLY option to cmake. This removes the dependency on libunbound.
  • Currently getdns only offers two helper functions to deal with IDN: getdns_convert_ulabel_to_alabel and getdns_convert_alabel_to_ulabel. If you do not need these functions, getdns can be configured to compile without them by setting theUSE_LIBIDN2 option to cmake to OFF.
  • When ENABLE_STUB_ONLY is ON, and USE_LIBIDN2 is OFF, getdns has only one dependency left, which is OpenSSL.

Extensions and Event loop dependencies

The implementation works with a variety of event loops, each built as a separate shared library. See this Doxygen page and [this man page](https://getdnsapi.net/documentation/manpages/#ASYNCHRONOUS USE) for more details.

Using getdns_query

Example test queries using getdns_query (pointed at Google Public DNS) and requesting the call_reporting extension which provides information on the transport and query time:

getdns_query -s example.com A @8.8.8.8 +return_call_reporting (UDP) getdns_query -s example.com A @8.8.8.8 -T +return_call_reporting (TCP) getdns_query -s example.com A @8.8.8.8 -L +return_call_reporting (TLS without authentication) getdns_query -s getdnsapi.net A +dnssec_return_status +return_call_reporting (DNSSEC)

Stubby

  • Stubby is an implementation of a DNS Privacy enabled stub resolver that encrypts DNS queries using TLS. It is currently suitable for advanced/technical users - all feedback is welcome!
  • Details on how to use Stubby can be found in the Stubby Reference Guide.
  • Also see dnsprivacy.org for more information on DNS Privacy.

Experimental support for GnuTLS

A project to allow user selection of either OpenSSL or GnuTLS is currently a work in progress. At present a user may select to use GnuTLS for the majority of the supported functionality, however, OpenSSL is still required for some cryptographic functions.

Regression Tests

A suite of regression tests are included with the library, if you make changes or just want to sanity check things on your system take a look at src/test. You will need to install libcheck. The check library is also available from many of the package repositories for the more popular operating systems. Note: The tests currently do not run on Windows because of a dependancy on bash.

DNSSEC dependencies

For the library to be DNSSEC capable, it needs to know the root trust anchor. The library will try to load the root trust anchor from /etc/unbound/getdns-root.key by default. This file is expected to have one or more DS or DNSKEY resource records in presentation (i.e. zone file) format. Note that this is different than the format of BIND.keys.

Zero configuration DNSSEC

When the root trust anchor is not installed in the default location and a DNSSEC query is done, getdns will try to use the trust anchors published here: http://data.iana.org/root-anchors/root-anchors.xml . It will validate these anchors with the ICANN Certificate Authority certificate following the procedure described in [RFC7958]. The root-anchors.xml and root-anchors.p7s S/MIME signature will be cached in the $HOME/.getdns directory on Unixes, and the %appdata%\getdns directory on Windows.

When using trust-anchors from the root-anchors.xml file, getdns will track the keys in the root DNSKEY rrset and store a copy in $HOME/.getdns/root.key on Unixes, and %appdata%\getdns\root.key on Windows. Only when the KSK DNSKEY's change, a new version of root-anchors.xml is tried to be retrieved from data.iana.org.

A installed trust-anchor from the default location (/etc/unbound/getdns-root.key) that fails to validate the root DNSKEY RRset, will also trigger the "Zero configuration DNSSEC" procedure described above.

Support

Mailing lists

We have a getdns users list for this implementation.

Tickets and Bug Reports

Tickets and bug reports should be reported via the GitHub issues list.

Features of this release

Goals

The goals of this implementation of the getdns API are:

  • Provide an open source implementation, in C, of the formally described getdns API by getdns API team at https://getdnsapi.net/spec.html
  • Support FreeBSD, OSX, Linux (CentOS/RHEL, Ubuntu)
  • Support Windows 10
  • Include examples and tests as part of the build
  • Document code using doxygen
  • Leverage github as much as possible for project coordination
  • Follow the BSD coding style/standards ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-current/src/share/misc/style

Non-goals (things we will not be doing at least initially) include:

  • implementation of the traditional DNS related routines (gethostbyname, etc.)

Language Bindings

In parallel, the team is actively developing bindings for various languages. For more information, visit this webpage.

Unsupported getDNS Features

The following API calls are documented in getDNS but not supported by the implementation at this time:

  • Detecting changes to resolv.conf and hosts
  • MDNS, NIS and NetBIOS namespaces (only DNS and LOCALFILES are supported)

Minor omissions

The following minor implementation omissions are noted:

Recursive mode does not support:

  • TLS as a transport
  • Non-zero connection idle timeouts or query pipelining
  • Anything other than query_type and resolution_type in the return_call_reporting extension

Stub mode does not support:

  • Non zero idle timeouts for synchronous calls

Known Issues

  • None

Supported Platforms

The platforms listed here are intended to help ensure that we catch platform specific breakage prior to release.

  • Ubuntu 18.04 LTS and newer LTS releases
  • Microsoft Windows 10
  • FreeBSD 11.3 and newer
  • RHEL/CentOS 8
  • OSX 10.14 and 10.15

Platform Specific Build Notes

Build Status

FreeBSD

If you're using FreeBSD, you may install getdns via the ports tree by running: cd /usr/ports/dns/getdns && make install clean

If you are using FreeBSD 10 getdns can be intalled via 'pkg install getdns'.

Ubuntu

getdns should also work on Ubuntu 16.04, however if you require IDN functionality you will have to install a recent version of libidn2 via a ppa e.g. from https://launchpad.net/~ondrej/+archive/ubuntu/php

You will also have to build Unbound from source code to provide libunbound at version >= 1.5.9.

OSX

A self-compiled version of OpenSSL or the version installed via Homebrew is required and the options OPENSSL_ROOT_DIR, OPENSSL_CRYPTO_LIBRARY and OPENSSL_SSL_LIBRARY can be used to specify the location of the libraries. Note: If using a self-compiled version, manual configuration of certificates into /usr/local/etc/openssl/certs is required for TLS authentication to work.

Homebrew

If you're using Homebrew, you may run brew install getdns. By default, this will only build the core library without any 3rd party event loop support.

To install the event loop integration libraries that enable support for libevent, libuv, and libev, run: brew install getdns --with-libevent --with-libuv --with-libev. All switches are optional.

Note that in order to compile the examples, the --with-libevent switch is required.

Additionally, getdns is linked against the the OpenSSL library installed by Homebrew. Note that the Homebrew OpenSSL installation clones the Keychain certificates to the default OpenSSL location so TLS certificate authentication should work out of the box.

Microsoft Windows 10

You will need CMake for Windows. Installers can be downloaded from https://cmake.org/download/.

Windows versions of the following libraries are available using the vcpkg package manager.

  • OpenSSL
  • libevent
  • libiconv (required for libidn2)
  • libidn2
  • libyaml
  • libuv

Once these are installed, set CMake variables CMAKE_INCLUDE_PATH and CMAKE_LIBRARY_PATH to the vcpkg include and library directories e.g. ../vcpkg/installed/x64-windows/include and ../vcpkg/installed/x64-windows/lib.

To generate a project suitable for use in Visual Studio, select the appropriate Visual Studio generator in CMake. Once generated, the cmake-gui Open Project button can be used to load the project into Visual Studio.

Limitations on Windows

Full support for Windows is a work in progress. The following limitations will be addresses in future:

  • At present, no native Windows DLL version of libunbound exists; support for linking against libunbound is not currently available. The default build option for ENABLE_STUB_ONLY_ is ON for Windows.

  • The getdns unit tests (built with make test) require libcheck which is not currently available for Windows and so cannot be built.

  • The getdns tpkg test suite is not currently supported on Windows.

  • The detection of the location of the /etc/hosts file should be optimised - it currently assumes Windows is installed in the default directory on the C: drive

Contributors

  • Claus Assman
  • Theogene Bucuti
  • Andrew Cathrow, Verisign Labs
  • Neil Cook
  • Saúl Ibarra Corretgé
  • Craig Despeaux, Verisign, Inc.
  • John Dickinson, Sinodun
  • Sara Dickinson, Sinodun
  • Robert Edmonds
  • Angelique Finan, Verisign, Inc.
  • Simson Garfinkel
  • Daniel Kahn Gillmor
  • Neel Goyal, Verisign, Inc.
  • Bryan Graham, Verisign, Inc.
  • Robert Groenenberg
  • Jim Hague, Sinodun
  • Paul Hoffman
  • Scott Hollenbeck, Verising, Inc.
  • Christian Huitema
  • Shumon Huque, Verisign Labs
  • Jelte Janssen
  • Guillem Jover
  • Shane Kerr
  • Anthony Kirby
  • Olaf Kolkman, NLnet Labs
  • Sanjay Mahurpawar, Verisign, Inc.
  • Allison Mankin, Verisign, Inc. - Verisign Labs.
  • Sai Mogali, Verisign, Inc.
  • Linus Nordberg
  • Benno Overeinder, NLnet Labs
  • Joel Purra
  • Tom Pusateri
  • Prithvi Ranganath, Verisign, Inc.
  • Hoda Rohani, NLnet Labs
  • Rushi Shah, Verisign, Inc.
  • Vinay Soni, Verisign, Inc.
  • Melinda Shore, No Mountain Software LLC
  • Bob Steagall, Verisign, Inc.
  • Andrew Sullivan
  • Ondřej Surý
  • Willem Toorop, NLnet Labs
  • Gowri Visweswaran, Verisign Labs
  • Wouter Wijngaards, NLnet Labs
  • Glen Wiley, Verisign, Inc.
  • Paul Wouters

Acknowledgements

The development team explicitly acknowledges Paul Hoffman for his initiative and efforts to develop a consensus based DNS API. We would like to thank the participants of the getdns-api mailing list (discontinued) for their contributions.

getdns's People

Contributors

amialkow avatar anthonykirby avatar banburybill avatar cedespeaux avatar chall37 avatar dkg avatar elindsey avatar fcelda avatar glenwiley avatar gmadkat avatar huitema avatar johndickinson avatar jsabo avatar ln5 avatar maciejsszmigiero avatar madebr avatar melindashore avatar monkeydogma avatar neheb avatar neilcook avatar ngoyal avatar nitinsinghit avatar paulehoffman avatar saghul avatar saradickinson avatar shane-kerr avatar themiron avatar thesamesam avatar wcawijngaards avatar wtoorop avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

getdns's Issues

libev on FreeBSD

Following error trying to use libev on FreeBSD. This was in a call to getdns_general_sync!

Assertion failed: (("libev: ev_signal_start called with illegal signal number", w->signum > 0 && w->signum < EV_NSIG)), function ev_signal_start, file ev.c, line 3748.

libuv works fine.

set_ub_dns_transport() not working

I have been checking some stuff with wireshark and everything appears to go over UDP regardless of the the transport set in getdns_context_set_dns_transport();

This appears to be due to missing :'s in the six calls to set_ub_string_opt() in set_ub_dns_transport.
The current code reads:
set_ub_string_opt(context, "do-tcp", "yes");
it should read
set_ub_string_opt(context, "do-tcp:", "yes");

See http://unbound.net/documentation/libunbound.html

I will do a PR once I figure out a nice way to test the actual transport used. Please shout if this is me doing something stupid!

OS X installer pollutes /usr/local

Since homebrew apparently doesn’t install the libgetdns_ext_event libs required to try the examples (cf. Homebrew/legacy-homebrew#28027), I tried the binary installer and it appears that it just dumps everything into /usr/local :

drwxr-xr-x    5 root   wheel   170B 26 Feb 00:08 getdns
-rwxr-xr-x    1 root   wheel   110K 26 Feb 00:08 libgetdns-0.1.0.0.dylib
-rw-r--r--    1 root   wheel   499K 26 Feb 00:08 libgetdns.a
lrwxr-xr-x    1 58540  wheel    23B  1 Apr 08:21 libgetdns.dylib -> libgetdns-0.1.0.0.dylib
-rw-r--r--    1 root   wheel   1,1K 26 Feb 00:08 libgetdns.la
-rwxr-xr-x    1 root   wheel    10K 26 Feb 00:08 libgetdns_ext_event-0.1.0.0.dylib
-rw-r--r--    1 root   wheel    12K 26 Feb 00:08 libgetdns_ext_event.a
lrwxr-xr-x    1 58540  wheel    33B  1 Apr 08:21 libgetdns_ext_event.dylib -> libgetdns_ext_event-0.1.0.0.dylib
-rw-r--r--    1 root   wheel   1,3K 26 Feb 00:08 libgetdns_ext_event.la
drwxr-xr-x    3 root   wheel   102B 26 Feb 00:08 doc

Please, either install to /opt/getdns if you want a whole hierarchy or (even better) use the appropriate sub-directories like /usr/local/lib, /usr/local/include, etc.

FWIW, the installers are also outdated (0.1.0 vs 0.1.1).

Crash when destroying context during canceled callback

May be related to fix for #18

Create a context, issue an async query, cancel the query. In the callback, destroy the context. I am guessing this occurs in a timeout also. If this occurs in timeout, we would want to make sure the event loop extensions still work with minimal/no change.

Should header counts reflect actual records returned with dnssec_return_secure_only?

cedespeaux:

So based on the information in the spec, I'm not sure if this is the expected result or not. I am querying dell,com, which is an unsigned domain, with qtype ANY and the dnssec_return_secure_only extension. None of the ANSWER section records are returned since the domain is insecure, however, the header still reports "ancount": 12 representiing the number of records that would be returned without the extension. This may be the correct behaviour but it's hard to say based on the information in the spec alone.

For that matter, should the ADDITIONAL records be returned? They aren't secure either.

wtoorop:
Hi Craig & the rest, I am wrestling a bit with what to do here, though I do think that the procedure you observed (of not including answer resource records based on DNSSEC policy) is confusing. I would rather handle the inclusion/exclusion policy on a packet/reply-level. I have changed the behaviour and it is now the following: - All DNSSEC extension add the "dnssec_status" to the reply dicts. - With "dnssec_return_status" and "dnssec_return_only_secure", the "status" in the response dict is GETDNS_RESPSTATUS_NO_NAME when all replies are NXDOMAIN and/or BOGUS. - With "dnssec_return_only_secure", the "status" in the response dict is GETDNS_RESPSTATUS_NO_SECURE_ANSWERS when non of the replies are SECURE, even when all were NXDOMAIN. - When "dnssec_return_validation_chain" is set, besides the validation chain, all replies are returned, even when other DNSSEC extensions are set that would otherwise exclude these replies. This is the only modus were one can observe the "dnssec_status" to be GETDNS_DNSSEC_BOGUS. - When the "dnssec_return_status" extension is set (and "dnssec_return_validation_chain" is not), only non-bogus replies are returned. - When the "dnssec_return_only_secure" extension is set (and "dnssec_return_validation_chain" is not), only secure replies are returned. Speak-up when you believe this should be handled differently, or that the specification should be modified to be clearer on this.

(#111 from private repo)

issue patch release Friday 3/7?

Per semantic versioning we have lattitude to change things without incrementing the patch number since we are on release 0, however it might be good to increment it anyway (so that we have tag/branch 0.1.1) to pick up some of the recent changes.

I would like to include a few more fixes to the configure script for the next patch release, what do folks think about marking that release this Friday?

doxygen docs need attention

Our generated documentation via doxygen is weak, we need to spend some time properly documenting the code and adding sufficient details to support doxygen more effectively.

File descriptor revision

Related to the ldns refactoring and needs for TCP

Willem will create function prototypes to discuss, because design is needed

getdns_dict_remove_name returns GETDNS_RETURN_GENERIC_ERROR on success

on cdespeaux's behalf: While working on the Perl bindings for getdns, I have stumbled across a bug. I added a call to getdns_dict_remove_name to my "make test" file after defining the XSUB to verify I could remove a name from a dict. Although, the item was successfully removed, getdns_dict_remove_name returned GETDNS_RETURN_GENERIC_ERROR rather than GETDNS_RETURN_GOOD. Looking at the code, the last line in the subroutine is "return GETDNS_RETURN_GENERIC_ERROR;".

Typo in documentation (DNSSEC example)

The first DNSSEC example in https://getdnsapi.net/spec.html#a6 seems wrong: it says

this_ret = getdns_dict_get_int(this_rdata, "dnssec_status", &this_dnssec_status);

but it should be:

this_ret = getdns_dict_get_int(this_rdata, "dnssec_status", this_dnssec_status);

per the definition of getdns_dict_get_int:

getdns_dict_get_int (getdns_dict *this_dict,
          char *name,
          uint32_t *answer)

Agenda for 12 August 2014

12 August 2014

getdns weekly meeting Agenda:

  • github issues for the 0.1.4 release milestone (reminder: add yours today)
  • Transferred from last week: Python update (Melinda) and Python questions/comments (Shumon)
  • Coordination of getdns-related talks for DNS-OARC and DNSSEC Workshop at ICANN51 (due date for ICANN workshop is 8/13)
  • Coordination on RIPE workshop/hands-on tutorial proposal - interested in proposing and serving as instructors: Glen / Shumon / Willem(?) / ?
  • Expected timing of multi-file descriptor revision (Neel)

Meeting ends after 45 mins

————————————————

Follow-on TCP-related meeting (same Hangout) Agenda:

  • Required participants from Duane, Allison, John, Sara and Willem
  • Discussion of TCP, T-DNS, ldns plans
  • Meeting ends after 45 mins

simplified presentation of response results

There is some concern that developers using the API might find it unpleasant to wade through the response data specified in the description so there might be room to offer the results in a more easily digestible format.

One approach would be to offer an entry point that returns the data as a struct, another approach would be to offer a helper function that extracts a specific piece of data from the response (such as the IPv4/6 address from an A record).

(#23 from private repo)

release 0.1.2 planning

  • commits done by COB Wed, 5/22, branch created from master
  • testing release branch Thu/Fri 5/23-5/24, bug fixes only
  • release announced COB Fri 5/24

tests failing with some event handlers.

On FreeBSD 10.0-RELEASE-p1 running configure with the following arguments

--with-libevent
make example ok (as expected from the README)
make test failed

--with-libuv
make example failed (as expected from the README)
make test ok

--with-libev
make example failed (as expected from the README)
make test failed

No args.
make example failed (as expected from the README)
make test ok

OS X binaries work only for gwiley :)

After I finally managed to compile an example on OS X (you seriously should document that) using

clang  -I/usr/local/getdns -L/usr/local -I/usr/local -levent -lgetdns_ext_event -lgetdns t.c

the binary crashes with the following error:

dyld: Library not loaded: /Users/gwiley/getdnsosx/export/lib/libgetdns_ext_event-0.1.0.0.dylib
  Referenced from: /Users/hynek/gda/./a.out
  Reason: image not found
fish: Job 1, './a.out' terminated by signal SIGTRAP (Trace or breakpoint trap)

In other words: nobody except Glen has ever used the OS X binary package successfully.

I’m not really intimate with OS X’s linking/loading/packaging, but it appears that https://github.com/getdnsapi/getdns/blob/master/getdns.pmdoc/02lib-contents.xml is the problem.

very simple problem when compile the example

all, I download the tarball ,and install with no error, when I compile the example, an error occurred.
/usr/bin/ld: cannot find -lgetdns_ext_event.

could someone help to resolve the problem??

MS-Windows support

We need to build for MS-Windows - this is a significant enough body of work to merit its own separate issue.

system and per-user configuration files

It would be good to support an optional system wide and per user configuration file that affects the run-time performance of the getdns library. If the files do not exist then the library runs the way it is currently designed to.

The system wide configuration would be in /etc/getdns.conf and the per user file would be ~/.getdns.conf

Some of the elements addressed in the configuration files include:

  • special behavior for particular zones, forwarding, etc.
  • whether to accept dhcp provided resolvers or override with manually specified resolvers
  • default settings in the context such as stub vs. recursive mode for the library
  • cache behavior - whether to share with the system or per user, another issue addresses this in more detail

setting namespaces in prepare_for_resolution does not work on per query basis

getdns_general uses namespaces and getdns_address does not, so one can choose to use namespaces on a per query basis. However, currently namespaces are set in the prepare_for_resolution function, which initializes the "context" for those namespaces.

Solution that comes to mind:

  1. having two unbound contexts, one that does local names and one that does dns only.
  2. Or lift local name lookup out of unbound and put it in getdns.

I prefer the second. (Willem & Neel)

(#106 from private repo)

Errors printed when getdns_context_destroy occurs in callback

I see the following statements put out on the console when destroying the context within a callback.

[1393946950] libunbound[32477:0] error: libunbound/libunbound.c at 501 could not pthread_mutex_lock(&ctx->rrpipe_lock): Invalid argument
[1393946950] libunbound[32477:0] error: tube msg read failed: Bad file descriptor
[1393946950] libunbound[32477:0] error: libunbound/libunbound.c at 503 could not pthread_mutex_unlock(&ctx->rrpipe_lock): Invalid argument

The process exits fine, but ideally we shouldn't see prints like this. I believe these occur because we are firing the callback before our call to ub_process_async returns. One solution is to have the context queue up the callbacks to fire, and then fire them off once ub_process_async exits.

Custom record type parsing hooks

Provide a means for users to register their own parsers for RR types that allow them to append to the generic dictionary that contains what getdns has parsed out. For unknown types, this dictionary should initially contain the raw rdata along with type, etc.

STUB mode not honored if query has already been performed in RECURSING mode

After Glen and I agreed that query tests should be done in both recursive and stub mode I began changing my getdns_general() test suite to issue a query in recursive mode, then switch to stub mode, and issue another query. For the recursive query, I query something like "google.com" A and generically verify that I get address records in the ANSWER section, etc. For the stub mode query, I am querying a local named server I setup with a canned zone file. In this case, I actually verify that I get the exact response recorded in a character constant defined in a header file that was produced by my "golden master" test program. What I've found is that if I do the "google.com" query in recursive mode that the next query for "kitchensink.net" is also done in recursive mode even though I've switched the context to stub mode. I know this because the real "kitchensink.net" returns different records (A, SOA, etc.) than my test zone file does. If I comment out the getdns_general() call to query "google.com" then the stub mode test passes (i.e., I get the expected response).

For now to keep my test progress flowing, I am going to destroy and recreate the context between these two queries.


Neel:

We will need to re-create the unbound context. I think this is a valid bug for sure. The specification doesn't call out details on what happens to outbound requests when the resolution mode changes. I think we should document our approach in our implementation specific documentation. I propose the following for our initial release:

setting the resolution mode to something different sets a flag (just like it does today).
the context update callback is fired if one is set
when a query is issued and the resolution mode has changed, then all outbound requests are canceled prior to the new query being sent. The callback type will be GETDNS_CALLBACK_CANCEL. Alternatively, we can not fire the callback, or propose a new type that is a bit more descriptive than cancel.

(#113 from private repo)

release 0.1.4 planning

timeframe: by August 31

features/fixes:

  • fix TCP so it works when called (issue #54) - done - Python release needs
  • some TCP unit tests (John)
  • Bortzmayer documentation bug - fixed
  • openpgp RR decoding (Shumon)

OOOP support

Blocked waiting for pipelining
Will need server side modifications to allow testing

suggestion for bindata helper functions

from Duane W during the hackathon:

I used src/example/example-hostname.c as my guide and was confused by this line for a short while:

struct getdns_bindata this_type = { 5, (void *)"IPv4" };

It took me a while to realize 5 was the length of "IPv4". Maybe there could be a helper function to populate a bindata. For example:

struct getdns_bindata this_type;
getdns_bindata_set(&this_type, "IPv4", sizeof("IPv4"));

or

getdns_bindata_set_from_str(&this_type, "IPv4");

(#57 from private repo)


I'd like to include the set/modify bindata functions that Bob Steagall's suggested

getdns_return_t getdns_list_set_bindata_2(struct getdns_list *the_list, size_t index, size_t bindata_size, uint8_t *bindata_content);
getdns_dict_set_bindata_2(struct getdns_dict *the_dict, const char *name, size_t bindata_size, uint8_t *bindata_content);
(#64 from private repo)

Ability to disable checking for libev/libevent/libuv/doxygen via configure

For package maintainers, it is challenging if there isn't an easy way to disable optional extensions. Ideally, this would also include a means to specify the path to search for the library/headers.

Today, we will automatically add support for libev/libevent/libuv/doxygen in the event they are found.

Consider using JPRS idnkit in order to provide IDN 2008

There's just been a new release of the idnkit (C with some other language APIs as well), developed and maintained by JPRS, with a non GPL open source license and full support of IDN 2008. It was recommended by a colleague who works in the area of DNS support for native American languages.

(#83 from private repo)

automation of dnssec trust-anchor and auto-update

On 2/11 we discussed where to apply unbound_anchor (Make install? what about local install options)
and how not to send out just a hard-coded root trust anchor.

Decision for 2/25 - Willem removes the hard-coded trust anchor. Make install will run unbound_anchor.

In later releases, we will enhance this.
(#104 from private repo)

Agenda - 14-06-24

Agenda items

  • 0.1.3 release - who could execute/get this out this week?
  • 0.1.4 and 0.1.5 release planning/roadmapping - review updated issues #46, #47
  • tdns update
  • python update
  • Plan next bindings: perl, java, ruby, go, php, c++
  • Packaging - which other OS, how, and when?
  • Quick revisit of meeting time

Items for future meetings

  • Sunday after-dinner gathering in Toronto
  • Windows port update (once work starts)

Sync calls that get no response give the wrong return

The sync versions of commands do not follow the API design in an important way that has a very negative effect on the Python bindings. The spec says:

The async getdns functions return GETDNS_RETURN_GOOD if the call was properly formatted.
. . .
The value returned [by an sync call] is exactly the same as the response returned in the callback if you had used the async version of the function.

However, when a sync function goes to a stub that does not respond, it returns GETDNS_RETURN_GENERIC_ERROR even if the call is properly formatted. See the attached code, the output of which is:

% ./syncstub 8.8.8.8 www.imc.org
Recursive 8.8.8.8; Domain www.imc.org; RRtype 1
The address is 207.182.41.81

% ./syncstub 8.8.8.9 www.imc.org
Recursive 8.8.8.9; Domain www.imc.org; RRtype 1
The request returned GETDNS_RETURN_GENERIC_ERROR. Exiting.

This is a significant violation of the design in that the return of a function should not be used to indicate when an upstream resolver has an error. In the case of a stub getting no answer from its upstream, the return must be GETDNS_RETURN_GOOD, and the returned dict contains a replies_tree of [], meaning "there were no replies".

/* Make the call */
getdns_return_t dns_request_return = getdns_general_sync(ThisContext, DomainToLookUp, RRtypeToLookUp,
    Extensions, &ThisResponse);
if (dns_request_return == GETDNS_RETURN_BAD_DOMAIN_NAME)
{
    fprintf(stderr, "A bad domain name was used: %s. Exiting.\n", DomainToLookUp);
    /* ... */
}
else if (dns_request_return == GETDNS_RETURN_GENERIC_ERROR)
{
    fprintf(stderr, "The request returned GETDNS_RETURN_GENERIC_ERROR. Exiting.\n");
    /* ... */
}
else ...

GETDNS_RETURN_DNSSEC_WITH_STUB_DISALLOWED is never returned

op 16-02-14 12:26, amankin schreef:
Does the iterative code just swing into play even though in stub mode? Heh I talked with Paul Hoffman on this on Wednesday - when in stub mode, those extensions should mean 'forward the DNSSEC request' and we should either get responses suitable to the extension from our first hop or give an error if that does not happen.

What does that mean? The AD bit sets the "dnssec_status" to GETDNS_DNSSEC_SECURE and SERVFAIL sets "dnssec_status" to GETDNS_DNSSEC_BOGUS, the rest is GETDNS_DNSSEC_INSECURE?
DNSSEC iterative querying is not to happen

Not even with dnssec_return_validation_chain? Why not?

but a DNSSEC query in any three extensions should provide a result. Paul agreed the spec needs to express this differently.

Ok, this is our current behavior in stub mode: Currently our implementation does do iterative querying of DNSSEC records with all three extensions. This works perfectly with an DNSSEC aware resolver (even when it doesn't do the DNSSEC itself), but will render all answers BOGUS when talking to an incapable DNSSEC resolver. (because the DNSKEY of the root doesn't have RRSIGs)

-- Willem
(#112 from private repo)

port to capsicum

It would be interesting to port getdns to capsicum - a bare bones port that deals with the changed system calls would be a sufficient first step. Further improvements to make the library more security aware might be worth discussing.

resolver_type vs. resolution_type

The setter is getdns_context_set_resolution_type() but the in the information returned from getdns_context_get_api_information() the dictionary key is "resolver_type". These should probably be brought into alignment; as Neel pointed out it would have less impact on existing code to change the dictionary key to "resolution_type".

libevent on FreeBSD fails

examples on FreeBSD built with libevent do not work (fail with a broken pipe at run time). This should be fixed in the next release.

shared cache per system or per user

Support for shared cache. A user configurable (see issue #51 ) option to share the cache across processes on the same system and or for process running as the same user. This implies a separate process that can handle a persistent cache.

Convert master file format to getdns data structs

It would be useful to add an API where a trust anchor file can be added on a per context basis after it has been created. This may follow the context finalization rules. Mobile platforms can certainly benefit from this.

The API can be added to getdns_extra.h and then brought into the official header when we agree on a signature. I suggest something like:
getdns_return_t getdns_context_add_trust_anchor(getdns_context* context, const char* path); which is a mirror of the unbound API.

Should we take in a user specified format (unbound, bind, etc.) as well?

release 0.1.5 planning

This is a very tentative and future-looking list and we will be revising it frequently

timeframe:

features/fixes:

  • edns option support (client setting of MTU, support of registered codepoints)
  • per system and per user config files (issue #51 )
  • additional namespace support
  • integration with t-dns
  • sync with dnssd work
  • mdns support

bindings:

  • 2-3 additional language bindings - candidates Java, Perl, ruby, go, php, c++?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.