diff --git a/README.md b/README.md index c1a8bae4..42302b83 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Traditional access to DNS data from applications has several limitations: * 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 a prototype DNS Privacy enabled client called 'stubby' - see below for more details. +getdns also provides a experimental DNS Privacy enabled client called 'stubby' - see below for more details. ## Motivation for providing the API @@ -78,7 +78,7 @@ before building. As well as building the getdns library 2 other tools are installed by default by the above process: * getdns_query: a command line test script wrapper for getdns -* stubby: a DNS Privacy enabled client +* stubby: a experimental DNS Privacy enabled client Note: If you only want to build stubby, then use the `--enable-stub-only` and `--without-libidn` options when running 'configure'. @@ -99,9 +99,10 @@ The implementation works with a variety of event loops, each built as a separate ## Stubby -* Stubby is a prototype implementation of a DNS Privacy enabled stub resolver. Feedback is welcome! -* A default configuration file is available here uses a 'Strict' privacy usage profile using some of the available test DNS Privacy servers to resolve queries. Note these servers are test servers that offer no service guarantees. An alternative file can be specified with the '-C' flag -* If you would like minimal logging output from Stubby (which servers are used and connection level statistics) then also use the '--enable-debug-daemon' flag when running 'configure'. +* Stubby is an experimental implementation of a DNS Privacy enabled stub resolver. It is currently suitable for advanced/technical users - all feedback is welcome! Also see [dnsprivacy.org](https://dnsprivacy.org) for more information on DNS Privacy and stubby. +* By default stubby will attempt to use 'Opportunistic' Privacy for DNS queries. +* A sample configuration file is available in the source code (src/tools/stubby.conf) which uses 'Strict' Privacy and some of the available test DNS Privacy servers to resolve queries. Note these servers are test servers that offer no service guarantees. The location of a configuration file can be specified with the '-C' flag +* RECOMMENDED: Minimal logging output from Stubby is available (e.g. which servers are used and connection level statistics) by also using the '--enable-debug-daemon' flag when running 'configure'. To use stubby * Start stubby from the command line diff --git a/src/stub.c b/src/stub.c index ef74beb8..d9c35d7d 100644 --- a/src/stub.c +++ b/src/stub.c @@ -1546,9 +1546,11 @@ upstream_write_cb(void *userarg) case STUB_NO_AUTH: /* Cleaning up after connection or auth check failure. Need to fallback. */ stub_cleanup(netreq); +#if defined(DAEMON_DEBUG) && DAEMON_DEBUG DEBUG_DAEMON("%s %s : Conn closed : Transport=%s - *Failure*\n", STUB_DEBUG_DAEMON, upstream->addr_str, (upstream->transport == GETDNS_TRANSPORT_TLS ? "TLS" : "TCP")); +#endif if (fallback_on_write(netreq) == STUB_TCP_ERROR) { /* TODO: Need new state to report transport unavailable*/ netreq->state = NET_REQ_FINISHED; @@ -1847,8 +1849,10 @@ upstream_find_for_netreq(getdns_network_req *netreq) } /* Handle better, will give generic error*/ DEBUG_STUB("%s %-35s: MSG: %p No valid upstream! \n", STUB_DEBUG_SCHEDULE, __FUNCTION__, netreq); +#if defined(DAEMON_DEBUG) && DAEMON_DEBUG DEBUG_DAEMON("%s *FAILURE* no valid transports or upstreams available!\n", STUB_DEBUG_DAEMON); +#endif return -1; } diff --git a/src/tools/stubby.conf b/src/tools/stubby.conf new file mode 100644 index 00000000..3d3fd30e --- /dev/null +++ b/src/tools/stubby.conf @@ -0,0 +1,52 @@ +{ resolution_type: GETDNS_RESOLUTION_STUB +, dns_transport_list: [ GETDNS_TRANSPORT_TLS ] +, upstream_recursive_servers: + [ { address_data: 145.100.185.15 + , tls_auth_name: "dnsovertls.sinodun.com" + , tls_pubkey_pinset: + [ { digest: "sha256" + , value: 0xA132D34D34C181765337C70B83E3697B9524DDDB05A7118B43C0284033D5A0CC + } ] + }, + { address_data: 145.100.185.16 + , tls_auth_name: "dnsovertls1.sinodun.com" + , tls_pubkey_pinset: + [ { digest: "sha256" + , value: 0x659B41EB08DCC70EE9D624E6219C76EE31954DA1548B0C8519EAE5228CB24150 + } ] + }, + { address_data: 185.49.141.38 + , tls_auth_name: "getdnsapi.net" + , tls_pubkey_pinset: + [ { digest: "sha256" + , value: 0x7e8c59467221f606695a797ecc488a6b4109dab7421aba0c5a6d3681ac5273d4 + } ] + }, + { address_data: 2001:610:1:40ba:145:100:185:15 + , tls_auth_name: "dnsovertls.sinodun.com" + , tls_pubkey_pinset: + [ { digest: "sha256" + , value: 0xA132D34D34C181765337C70B83E3697B9524DDDB05A7118B43C0284033D5A0CC + } ] + }, + { address_data: 2001:610:1:40ba:145:100:185:16 + , tls_auth_name: "dnsovertls1.sinodun.com" + , tls_pubkey_pinset: + [ { digest: "sha256" + , value: 0x659B41EB08DCC70EE9D624E6219C76EE31954DA1548B0C8519EAE5228CB24150 + } ] + }, + { address_data: 2a04:b900:0:100::38 + , tls_auth_name: "getdnsapi.net" + , tls_pubkey_pinset: + [ { digest: "sha256" + , value: 0x7e8c59467221f606695a797ecc488a6b4109dab7421aba0c5a6d3681ac5273d4 + } ] + } + ] +, tls_authentication: GETDNS_AUTHENTICATION_REQUIRED +, tls_query_padding_blocksize: 256 +, edns_client_subnet_private : 1 +, listen_addresses: [ 127.0.0.1, 0::1 ] +, idle_timeout: 10000 +}