Commit Graph

116 Commits

Author SHA1 Message Date
Frank Schroeder 375825f34c Do not recurse when the service address is a local cname
Fixes #2795
2017-06-01 18:20:31 +02:00
Frank Schroeder b6c69ebf5d
agent: refactor DNS and HTTP server
* refactor DNS server to be ready for multiple bind addresses
* drop tcpKeepAliveListener since it is default for the HTTP servers
* add startup timeout watcher for HTTP servers identical to DNS server
2017-05-31 00:29:29 +02:00
Frank Schroeder 10540f8d5f
agent: fix logging
* use agent logger for consul/serf/raft/dns/agent/...
* support optional id for concurrent tests
2017-05-31 00:29:27 +02:00
Frank Schroeder 3e39f04527
dns: do not log socket close during shutdown 2017-05-31 00:29:27 +02:00
Frank Schroeder 632f837c98
agent: shutdown dns servers on error 2017-05-31 00:29:26 +02:00
James Phillips 3103f7f673 Merge pull request #2690 from zeroae/f-simple-rfc2782
RFC 2782 support with optional .service tag
2017-03-02 14:49:36 -08:00
James Phillips e9cc66ab51
Fixes issue with missing CNAME for services with non-IP addresses set in SRV responses. 2017-01-31 20:57:50 -08:00
Patrick Sodré c135c08fb2 Simple RFC 2782 support with optional .service tag
Add support for SRV queries of names matching:
_<service>._<protocol>.[.service][.datacenter]<.domain>
2017-01-30 19:46:02 -05:00
Kyle Havlovitz 8e621eb9c8 Set MaxStale default to 10 years and add a stale counter (#2481)
Default MaxStale to 10 years and add a counter at `consul.dns.stale_queries` that tracks when an agent serves a query that's stale by at least 5 seconds. Previously, MaxStale defaulted to 5 seconds and DNS would become unavailable after a short period of time with no leader. This new default allows DNS requests to still be served in the event of a long outage.

Fixes #2460.
2016-11-08 14:45:12 -05:00
James Phillips 7b98ae921e Adds support for DNS recurse truncation. (#2467)
* Return message from recurse even if truncated

Signed-off-by: Evan Farrar <efarrar@pivotal.io>

* Tweaks unit test.
2016-11-03 12:21:16 -07:00
Kyle Havlovitz 63534aca7e Added tests for lookups on the 'addr.consul' domain 2016-10-27 21:04:06 -07:00
Kyle Havlovitz 2a26597769 Give the service address in SRV lookup when it differs from the node's 2016-10-27 21:04:06 -07:00
Kyle Havlovitz 554440ab1d Resolve Consul CNAME records on external services (#2444) 2016-10-26 19:23:51 -07:00
Pivotal DX129 fe61650ef0 Merge remote-tracking branch 'upstream/master' 2016-09-01 10:15:32 -04:00
James Phillips ed7356dd5c
Changes default DNS allow_stale to true. 2016-08-30 13:55:19 -07:00
Pierre Delagrave d9bd41fc4d Renamed dns config parameter internal_client_timeout for recursor_timeout 2016-08-26 15:22:04 -04:00
Pierre Delagrave c8c4b9d344 Added a configurable timeout to the client making DNS queries to downstream name servers 2016-08-23 16:59:38 -04:00
James Phillips c0ff412650
Factors translate out into a separate file and makes safe for in-memory RPCs. 2016-08-15 15:05:02 -07:00
David van Geest cdeff022dd
Translate Address to tagged WAN address in HTTP API when appropriate. 2016-08-12 18:25:36 -07:00
James Phillips 456a4934f0
Runs `go fmt`. 2016-08-12 17:26:23 -07:00
Max Timchenko 3b08db47dc
Corrects two issues with DNS prepared query failover
When DNS prepared query fails over to another datacenter and the datacenter
returns some nodes, the DNS result does not translate WAN addresses even when
translation is enabled for SRV and A queries, and returns the wrong datacenter
(the one that failed over) for SRV queries.
2016-08-12 17:06:43 -07:00
James Phillips 17c10d78bc
Passes the index by reference so we can control the allocation. 2016-08-12 14:51:50 -07:00
James Phillips f7fcb03004
Makes name compares case-insensitive. 2016-08-12 12:16:21 -07:00
James Phillips 6332e2b367
Avoids allocations and function calls if no extra data is present. 2016-08-12 10:29:57 -07:00
James Phillips e30b99cef5
Renames "seen" to "resolved". 2016-08-11 22:01:57 -07:00
James Phillips 34d6c2d5e1
Fixes the DNS SRV trim bug. 2016-08-11 21:46:14 -07:00
James Phillips bcb0f71759
Finishes up DNS compression by adding opt-out, tests, and documentation. Fixes trim routine. 2016-08-11 16:27:08 -07:00
epipho 41db005d0b
Fix panic where r.Compress would be set before checking for errors. 2016-08-11 16:27:08 -07:00
epipho d965e90306
Compress all DNS responses to prevent them from going over the 512 byte
limit from RFC 1035
2016-08-11 16:27:08 -07:00
Ryan Uber 62884a22d4 consul: send agent source data as separate query source 2016-06-30 16:51:18 -07:00
Ryan Uber 104b234dde agent: always pass local agent query source, allow override 2016-06-30 12:11:48 -07:00
Ryan Uber d567d6a6d8 consul: send origin node + dc when executing prepared queries 2016-06-21 15:34:26 -07:00
Ryan Uber 865c264b9c agent: set origin during PQ execution 2016-06-20 14:24:42 -07:00
Sean Chittenden 69696a9c1b Correctly detect that an answer has been truncated 2016-03-29 19:52:31 -07:00
Sean Chittenden efe940e7c4 Remove dead and incorrect code
This functionality is handled further upstream in `trimUDPAnswers()`
2016-03-29 19:38:26 -07:00
Sean Chittenden c5c8daf07a Trim UDP responses per configuration 2016-03-29 19:27:21 -07:00
Sean Chittenden 9fb64ab114 Allow adjusting the number of DNS records in a response...
Based on work done by @fusiondog in #1583, extend the concept to use an integer instead of a boolean.

Fixes: #1583 && #1481
2016-03-29 19:23:56 -07:00
Patrick Feliciano 74623c372a Adding singleton option to DNS for getaddrinfo bug. 2016-03-29 19:23:07 -07:00
James Phillips 5c80647e34 Tweaks algorithm so it's safe with an empty list and adds a PQ test. 2016-03-08 23:09:09 -08:00
Igor Dubinskiy 3a25860270 Make sure UDP DNS responses aren't larger than allowed 2016-03-07 16:41:17 -08:00
James Phillips 6790930c4e Factors address translation into a single function. 2016-02-07 13:39:37 -08:00
James Phillips c60a526fde Sets up config for more address tags down the road, renames struct members. 2016-02-07 10:37:34 -08:00
Evan Gilman de8fd561d0 Use a map for additional node addresses 2016-02-06 23:01:45 -08:00
Evan Gilman a3240d28ba Consider WAN addresses during Node and SRV record lookup 2016-02-06 23:01:45 -08:00
Evan Gilman 496cf5ae73 Implement `translate_wan_addrs` config option
This knob tells consul whether it should prefer the WAN address (if set)
when making service lookups in remote datacenters. This enables
reachability for remote services which are behind a NAT.
2016-02-06 23:01:45 -08:00
James Phillips 651f255b9b Converts the DNS metric to a gauge which gives us a count and a time. 2015-12-21 18:25:09 -08:00
James Phillips a4dc11167f Adds telemetry on number of DNS queries served, per-agent. 2015-12-21 17:01:28 -08:00
James Phillips cd6be4a88d Avoids taking the length again when parsing DNS queries. 2015-11-17 08:40:47 -08:00
James Phillips 4715c04c98 Adds a test to make sure a stale retry terminates. 2015-11-15 17:06:00 -08:00
James Phillips e9480ecb02 Plumbs the service name back and uses agent-specific TTL settings as a fallback. 2015-11-15 17:06:00 -08:00