Commit Graph

3599 Commits

Author SHA1 Message Date
Miek Gieben 83f7d658ac Merge pull request #309 from corny/patch-1
README: public-dns has moved
2016-02-05 09:40:07 +00:00
Julian K 4d05cbc9ba README: public-dns has moved 2016-02-03 19:53:21 +01:00
Miek Gieben 3d66e3747d Merge pull request #307 from everclear/patch-1
New user added
2016-01-29 16:34:59 +00:00
everclear b633e89c58 New user added 2016-01-29 16:26:44 +00:00
Miek Gieben 4687536c72 Merge pull request #302 from TomOnTime/tlim_newstuff
Added new functions: TrimDomain(), AddDomain().
2016-01-25 17:15:38 +00:00
tal@whatexit.org 808f9308ef Added new functions: TrimDomainName()/AddOrigin()
* TrimDomainName() Trims the domain off a FQDN.
  * AddOrigin() Adds a domain to a shortname or leaves a FQDN alone.
2016-01-25 12:08:29 -05:00
Miek Gieben c144371d31 Merge pull request #305 from shawnps/patch-3
typo
2016-01-24 07:46:31 +00:00
Shawn Smith 4d6d450eed typo 2016-01-23 15:39:59 -08:00
Miek Gieben 5c01f20c3a Merge pull request #304 from shawnps/gofmt
gofmt -s
2016-01-23 08:13:56 +00:00
shawnps 0cea3842b9 gofmt -s 2016-01-22 08:44:49 -08:00
Miek Gieben 85b661b2a6 Merge pull request #303 from client9/master
minor spelling corrections
2016-01-20 07:47:41 +00:00
Nick Galbreath a7f8fcc762 spelling 2016-01-19 14:24:18 -08:00
Nick Galbreath 5cbabd2322 spelling 2016-01-19 14:23:11 -08:00
Miek Gieben 297a77c2fb Merge pull request #300 from rafaeljusto/dns-over-tls
DNS over TLS
2016-01-11 18:45:12 +00:00
Rafael Dantas Justo ad79b3f5fb Change documentation based on @miekg comments
See #297
2016-01-11 08:40:14 -02:00
Rafael Dantas Justo 72c041d2f5 Create new function ListenAndServeTLS to easy run a DNS server with TLS support
Using the ListenAndServe with network as "tcp-tls" will cause an error, as the
certificates weren't informed. To solve that we created the function
ListenAndServeTLS that will configure a DNS server listening TCP and handling
requests on incoming TLS connections.

See #297
2016-01-08 13:20:22 -02:00
Rafael Dantas Justo a9978c4481 Add new feature to documentation
See #297
2016-01-08 11:34:38 -02:00
Rafael Dantas Justo 97f81a2cb5 Test client with TLS support
See #297
2016-01-08 11:34:08 -02:00
Rafael Dantas Justo 6fe70412bc Add option in server to allow DNS over TLS
We should allow the server to receive requests of an encrypted connection. This
is proposed on the document draft-ietf-dprive-dns-over-tls [1].

Now it is possible to initialize the DNS server to listen with TLS using
"tcp-tls" value in network parameter of ListenAndServe function, or passing a
listener initialized with tls.Listen to ActivateAndServe.

There's also an option in Server type to change the TLS confirguration, to
inform the certificates that are going to be used, or to change any other
desired option of tls.Config.

See #297

[1] http://tools.ietf.org/html/draft-ietf-dprive-dns-over-tls-02
2016-01-08 11:26:13 -02:00
Rafael Dantas Justo 91335a81cf Change how we enable DNS over TLS option
We are removing the TLS atributte from Client type. Now if you want to enable
DNS over TLS you should use the value "tcp-tls", "tcp4-tls" or "tcp6-tls" in
Net attribute.

See #297
2016-01-08 11:21:03 -02:00
Rafael Dantas Justo 5028d33048 Merge branch 'dns-over-tls' of github.com:rafaeljusto/dns into dns-over-tls 2016-01-08 07:28:41 -02:00
Rafael Dantas Justo ab77ae6734 Remove the TLS fallback strategy
After some thoughts, I realized that the fallback should be made by who is
using the client, as it will need to change the port (from 853 to 53). This
would also remove from the library the complexity of storing the recursive
nameservers that aren't working well with TLS (draft-ietf-dprive-dns-over-tls,
section 3.1).

See #297
2016-01-08 07:28:05 -02:00
Rafael Dantas Justo 1c62bb2781 Remove the TLS fallback strategy
After some thoughts, I realized that the fallback should be made by who is
using the client, as it will need to change the port (from 853 to 53). This
would also remove from the library the complexity of storing the recursive
nameservers that aren't working well with TLS (draft-ietf-dprive-dns-over-tls,
section 3.1).

Resolves #297
2016-01-07 13:36:36 -02:00
Rafael Dantas Justo 020f925824 Change low level read/write for TLS connection
As tlc.Conn is just a TCP connection after the handshake, we will modify the
TCP functions to work with an io.Reader/io.Writer parameter instead of a
net.TCPConn so we can reuse them.

See #297
2016-01-07 13:27:07 -02:00
Rafael Dantas Justo 124839738d Fallback to normal connection if TLS fails
As described in document draft-ietf-dprive-dns-over-tls [1] we should fallback
to normal connection (without TLS) if there's any error with the TLS
connection.

See #297

[1] http://tools.ietf.org/html/draft-ietf-dprive-dns-over-tls-02
2016-01-04 10:49:20 -02:00
Rafael Dantas Justo ce3e1286f2 TLS connection must be via TCP
See #297
2016-01-04 10:46:14 -02:00
Rafael Dantas Justo 72d475a8fe Allow changing the default TLS configuration
When starting a TLS connection in some environments, we usually disabled some
certificates checks to allow tests with self-signed certificates. To disable
this checks we need to change some TLS parameters when starting a connection,
and for that we need to inject this parameters in the API.

Now the Client will also have an attribute for the TLS configuration
parameters. For future refactories, we could change the TLS attribute from bool
to a struct that would store the "Enable" flag and the configuration.

See #297
2016-01-04 10:30:39 -02:00
Rafael Dantas Justo 0d866c924c Add option in client to allow DNS over TLS
We should allow the client to send requests to a recursive DNS server using a
encrypted connection. This is proposed on the document
draft-ietf-dprive-dns-over-tls [1].

For now we didn't allow the API user to change the TLS configuration (using
defaults). We also need to add the intelligence to fallback to normal DNS when
the TLS connection fails (as described in the draft).

See #297

[1] http://tools.ietf.org/html/draft-ietf-dprive-dns-over-tls-02
2016-01-04 10:05:29 -02:00
Miek Gieben 1756430e42 Merge pull request #299 from shawnps/patch-2
fix typos
2016-01-04 07:36:02 +00:00
Shawn Smith a5c6567b61 fix typos 2016-01-04 12:16:50 +09:00
Miek Gieben aed88e096f Remove the duplicate word length from the comment 2015-12-31 08:17:21 +00:00
Miek Gieben 0aa2579353 Merge pull request #298 from shawnps/patch-1
Fix typos
2015-12-31 08:16:30 +00:00
Shawn Smith 94231e71fe Fix typos 2015-12-31 14:16:30 +09:00
Miek Gieben c2d8398a25 Merge pull request #296 from vbatts/doc-fix
doc: example shows a conditional with non-bool
2015-12-22 19:00:42 +00:00
Vincent Batts 774b109199 doc: example shows a conditional with non-bool
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2015-12-22 12:04:16 -05:00
Miek Gieben 75e6e86cc6 Merge pull request #288 from leavengood/master
Set UDP conn to non-blocking on Linux to fix Shutdown()
2015-12-02 10:57:14 +00:00
Ryan Leavengood 7b51cba64a Set UDP conn to non-blocking on Linux to fix Shutdown()
The call to conn.File() causes Go to call dup() and then set the resulting FD
to be blocking. This sets the FD back to non-blocking, allowing Shutdown() to
work properly.

Fixes #279.
2015-12-01 17:15:42 -05:00
Miek Gieben f520760857 Lowercase all error msg from the tests 2015-11-26 14:12:38 +00:00
Miek Gieben 9e23f0c96e Fix data race 2015-11-26 14:03:51 +00:00
Miek Gieben 7e2a67cadb Merge pull request #287 from andrewtj/atj-issue286
Fix for issue 286 - panic after closing ResponseWriter in server handler
2015-11-26 13:50:10 +00:00
Andrew Tunnell-Jones 3062dcb751 Check server TCP conn exists before reading
w.tcp could be nil if the conn has been closed by a handler.
2015-11-26 08:10:55 +00:00
Andrew Tunnell-Jones cfa72d0862 Test closing TCP ResponseWriter in a handler 2015-11-26 08:04:38 +00:00
Miek Gieben d274557152 Merge pull request #281 from LevenLabs/master
Instead of removing all RRs on Truncated, attempt to unpack
2015-11-02 11:51:50 +00:00
Miek Gieben 497abb0c48 README: add section about maintenance
Say how we deal with backward compat and what we "guarantee" for
Go DNS.
2015-11-02 07:52:41 +00:00
James Hartig 2d2c2ebcfc Instead of removing all RRs on Truncated, attempt to unpack 2015-11-01 15:51:09 -05:00
Miek Gieben 6a1556664f Merge pull request #283 from bboreham/spin-less
Only re-try AcceptTCP() if the error is temporary
2015-10-30 21:51:19 +00:00
Bryan Boreham e54a6cf1bc Only re-try AcceptTCP() if the error is temporary 2015-10-30 17:08:27 +00:00
Miek Gieben adeb323cbc Merge pull request #277 from FiloSottile/typeToRR
Expose TypeToRR
2015-10-17 16:19:22 +01:00
Filippo Valsorda 023972bb19 Expose TypeToRR 2015-10-16 23:36:49 +01:00
Miek Gieben dfefa36553 Merge pull request #274 from FiloSottile/filippo/generate
Generate programmatically per-type code, including .len() and .copy()
2015-10-08 12:58:09 +01:00