open-consul/agent
Pierre Souchay 42f250fa53 Added SOA configuration for DNS settings. (#4714)
This will allow to fine TUNE SOA settings sent by Consul in DNS responses,
for instance to be able to control negative ttl.

Will fix: https://github.com/hashicorp/consul/issues/4713

# Example

Override all settings:

* min_ttl: 0 => 60s
* retry: 600 (10m) => 300s (5 minutes),
* expire: 86400 (24h) => 43200 (12h)
* refresh: 3600 (1h) => 1800 (30 minutes)

```
consul agent -dev -hcl 'dns_config={soa={min_ttl=60,retry=300,expire=43200,refresh=1800}}'
```

Result:
```
dig +multiline @localhost -p 8600 service.consul

; <<>> DiG 9.12.1 <<>> +multiline @localhost -p 8600 service.consul
; (2 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 36557
;; flags: qr aa rd; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;service.consul.		IN A

;; AUTHORITY SECTION:
consul.			0 IN SOA ns.consul. hostmaster.consul. (
				1537959133 ; serial
				1800       ; refresh (30 minutes)
				300        ; retry (5 minutes)
				43200      ; expire (12 hours)
				60         ; minimum (1 minute)
				)

;; Query time: 4 msec
;; SERVER: 127.0.0.1#8600(127.0.0.1)
;; WHEN: Wed Sep 26 12:52:13 CEST 2018
;; MSG SIZE  rcvd: 93
```
2018-10-10 15:50:56 -04:00
..
ae Add -sidecar-for and new /agent/service/:service_id endpoint (#4691) 2018-10-10 16:55:34 +01:00
cache merge feedback: fix typos; actually use deliverLatest added previously but not plumbed in 2018-10-10 16:55:34 +01:00
cache-types merge feedback: fix typos; actually use deliverLatest added previously but not plumbed in 2018-10-10 16:55:34 +01:00
checks Add -sidecar-for and new /agent/service/:service_id endpoint (#4691) 2018-10-10 16:55:34 +01:00
config Added SOA configuration for DNS settings. (#4714) 2018-10-10 15:50:56 -04:00
connect xDS Server Implementation (#4731) 2018-10-10 16:55:34 +01:00
consul Added SOA configuration for DNS settings. (#4714) 2018-10-10 15:50:56 -04:00
exec
local Proxy Config Manager (#4729) 2018-10-10 16:55:34 +01:00
metadata do not bootstrap with non voters 2018-09-19 17:41:36 -07:00
mock
pool
proxycfg merge feedback: fix typos; actually use deliverLatest added previously but not plumbed in 2018-10-10 16:55:34 +01:00
proxyprocess Add -sidecar-for and new /agent/service/:service_id endpoint (#4691) 2018-10-10 16:55:34 +01:00
router Remove unnecessary nil checks 2018-03-27 10:59:42 -05:00
structs connect: add ExternalTrustDomain to CARoot fields 2018-10-10 12:16:47 -07:00
systemd
token agent: add primary_datacenter and connect replication config options 2018-10-10 12:17:59 -07:00
xds merge feedback: fix typos; actually use deliverLatest added previously but not plumbed in 2018-10-10 16:55:34 +01:00
acl.go Add SidecarService Syntax sugar to Service Definition (#4686) 2018-10-10 16:55:34 +01:00
acl_endpoint.go
acl_endpoint_test.go BUGFIX: Unit test relying on WaitForLeader() did not work due to wrong test (#4472) 2018-08-06 19:46:09 -04:00
acl_test.go BUGFIX: Unit test relying on WaitForLeader() did not work due to wrong test (#4472) 2018-08-06 19:46:09 -04:00
agent.go agent: add primary_datacenter and connect replication config options 2018-10-10 12:17:59 -07:00
agent_endpoint.go agent: add primary_datacenter and connect replication config options 2018-10-10 12:17:59 -07:00
agent_endpoint_test.go Fix up tests broken by master merge; add proxy tests to services command (and fix it!); actually run the proxycfg.Manager 2018-10-10 16:55:34 +01:00
agent_test.go Add SidecarService Syntax sugar to Service Definition (#4686) 2018-10-10 16:55:34 +01:00
bindata_assetfs.go Release v1.2.3 2018-09-13 15:22:25 +00:00
blacklist.go
blacklist_test.go
catalog_endpoint.go Support Agent Caching for Service Discovery Results (#4541) 2018-10-10 16:55:34 +01:00
catalog_endpoint_test.go Add Proxy Upstreams to Service Definition (#4639) 2018-10-10 16:55:34 +01:00
check.go
config.go
connect_auth.go Connect Envoy Command (#4735) 2018-10-10 16:55:34 +01:00
connect_ca_endpoint.go Fix CA pruning when CA config uses string durations. (#4669) 2018-09-13 15:43:00 +01:00
connect_ca_endpoint_test.go Fix more unstable tests in agent and command 2018-09-12 14:49:27 +01:00
coordinate_endpoint.go Merge pull request #3885 from eddsteel/support-options-requests 2018-03-16 09:20:16 -05:00
coordinate_endpoint_test.go Fix more unstable tests in agent and command 2018-09-12 14:49:27 +01:00
dns.go Added SOA configuration for DNS settings. (#4714) 2018-10-10 15:50:56 -04:00
dns_test.go Added SOA configuration for DNS settings. (#4714) 2018-10-10 15:50:56 -04:00
enterprise_delegate_oss.go Allow for easy enterprise/oss coexistence 2018-05-24 10:36:42 -04:00
event_endpoint.go Fixes memory leak when blocking on /event/list (#4482) 2018-08-02 14:54:48 +01:00
event_endpoint_test.go Fix more unstable tests in agent and command 2018-09-12 14:49:27 +01:00
health_endpoint.go Support Agent Caching for Service Discovery Results (#4541) 2018-10-10 16:55:34 +01:00
health_endpoint_test.go Add Proxy Upstreams to Service Definition (#4639) 2018-10-10 16:55:34 +01:00
http.go Connect Envoy Command (#4735) 2018-10-10 16:55:34 +01:00
http_oss.go Add -sidecar-for and new /agent/service/:service_id endpoint (#4691) 2018-10-10 16:55:34 +01:00
http_oss_test.go Close HTTP response in Agent test (HTTPAPI_MethodNotAllowed_OSS) 2018-04-10 13:18:46 -04:00
http_test.go Support Agent Caching for Service Discovery Results (#4541) 2018-10-10 16:55:34 +01:00
intentions_endpoint.go agent: 400 error on invalid UUID format, api handles errors properly 2018-06-27 07:40:06 +02:00
intentions_endpoint_test.go agent: 400 error on invalid UUID format, api handles errors properly 2018-06-27 07:40:06 +02:00
keyring.go
keyring_test.go
kvs_endpoint.go
kvs_endpoint_test.go Improve reliability of tests with TestAgent (#4525) 2018-08-14 12:08:33 -04:00
notify.go Fixes memory leak when blocking on /event/list (#4482) 2018-08-02 14:54:48 +01:00
notify_test.go Fixes memory leak when blocking on /event/list (#4482) 2018-08-02 14:54:48 +01:00
operator_endpoint.go
operator_endpoint_test.go Fix unstable tests in agent, api, and command/watch 2018-09-10 16:58:53 +01:00
prepared_query_endpoint.go Support Agent Caching for Service Discovery Results (#4541) 2018-10-10 16:55:34 +01:00
prepared_query_endpoint_test.go Support Agent Caching for Service Discovery Results (#4541) 2018-10-10 16:55:34 +01:00
remote_exec.go
remote_exec_test.go Fix unstable tests in agent, api, and command/watch 2018-09-10 16:58:53 +01:00
retry_join.go agent: configure k8s go-discover 2018-09-05 13:38:13 -07:00
retry_join_test.go Vendoring update for go-discover. (#4412) 2018-07-25 16:21:04 -07:00
session_endpoint.go
session_endpoint_test.go Implementation of Weights Data structures (#4468) 2018-09-07 15:30:47 +01:00
sidecar_service.go merge feedback: fix typos; actually use deliverLatest added previously but not plumbed in 2018-10-10 16:55:34 +01:00
sidecar_service_test.go merge feedback: fix typos; actually use deliverLatest added previously but not plumbed in 2018-10-10 16:55:34 +01:00
signal_unix.go cli: forward SIGTERM to child process of 'lock' and 'watch' subcommands (#4737) 2018-10-02 15:57:21 -05:00
signal_windows.go cli: forward SIGTERM to child process of 'lock' and 'watch' subcommands (#4737) 2018-10-02 15:57:21 -05:00
snapshot_endpoint.go
snapshot_endpoint_test.go
status_endpoint.go
status_endpoint_test.go
testagent.go Fix #4515: Segfault when serf_wan port was -1 but reconnect_time_wan was set (#4531) 2018-08-17 14:44:25 -04:00
testagent_test.go
translate_addr.go
txn_endpoint.go
txn_endpoint_test.go Improve reliability of tests with TestAgent (#4525) 2018-08-14 12:08:33 -04:00
ui_endpoint.go agent: ExternalSources instead of Meta 2018-09-07 10:06:55 -07:00
ui_endpoint_test.go Added SOA configuration for DNS settings. (#4714) 2018-10-10 15:50:56 -04:00
user_event.go Spelling (#3958) 2018-03-19 16:56:00 +00:00
user_event_test.go
util.go cli: forward SIGTERM to child process of 'lock' and 'watch' subcommands (#4737) 2018-10-02 15:57:21 -05:00
util_test.go cli: forward SIGTERM to child process of 'lock' and 'watch' subcommands (#4737) 2018-10-02 15:57:21 -05:00
watch_handler.go Support legacy watch.HandlerFunc type for backward compat reduces impact of change 2018-06-14 09:42:05 -07:00
watch_handler_test.go Support legacy watch.HandlerFunc type for backward compat reduces impact of change 2018-06-14 09:42:05 -07:00