networking:dns:unbound:configure_encrypted_dns_with_caching
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
networking:dns:unbound:configure_encrypted_dns_with_caching [2020/12/06 11:09] – created peter | networking:dns:unbound:configure_encrypted_dns_with_caching [2020/12/06 11:33] (current) – peter | ||
---|---|---|---|
Line 76: | Line 76: | ||
Unbound distributes its requests evenly to all configured servers, so the more servers that are configured the fewer of your requests any one actually sees, making it more difficult to for them to get a complete picture of your activities even if they tried. | Unbound distributes its requests evenly to all configured servers, so the more servers that are configured the fewer of your requests any one actually sees, making it more difficult to for them to get a complete picture of your activities even if they tried. | ||
+ | |||
+ | ---- | ||
+ | |||
+ | The **forward-addr** have following syntax: | ||
+ | |||
+ | * The first part, before the @, is the IP address. | ||
+ | * The middle part, between @ and #, is the port. | ||
+ | * The trailing part, after the #, is the hostname. | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Handle Unresolved Responses ===== | ||
+ | |||
+ | In the above configuration, | ||
+ | |||
+ | To get Unbound to try to resolve the name itself in this case, you can add: | ||
+ | |||
+ | <file bash / | ||
+ | .... | ||
+ | forward-zone: | ||
+ | forward-first: | ||
+ | </ | ||
+ | |||
+ | <WRAP important> | ||
+ | **WARNING: | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Serve Names to Peers ===== | ||
+ | |||
+ | This configuration is designed to only serve names locally. | ||
+ | |||
+ | If you want to want to serve names to peers, you would need to open the desired ports (53 and perhaps 853) in your firewall and change access-control as follows: | ||
+ | |||
+ | <file bash / | ||
+ | ... | ||
+ | # Only allow access from localhost. | ||
+ | access-control: | ||
+ | access-control: | ||
+ | access-control: | ||
+ | access-control: | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Test that TLS is Working ===== | ||
+ | |||
+ | <code bash> | ||
+ | openssl s_client -connect localhost: | ||
+ | </ | ||
+ | |||
+ | You can find the name suitable for an upstream server using: | ||
+ | |||
+ | <code bash> | ||
+ | openssl s_client -connect 1.1.1.1:853 | ||
+ | </ | ||
+ | |||
+ | The host name you append to your **forward-addr** should match that given as the CN name reported by openssl. | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Workaround Man-In-The-Middle ===== | ||
+ | |||
+ | A corporate firewall that inserts itself as a man-in-the-middle in all connections may cause this setup to fail. | ||
+ | |||
+ | If your TLS CA bundle does not have the corporate certificates, | ||
+ | |||
+ | This situation prevents you from resolving any names. In addition, in some extreme cases, corporate firewalls block access to the DNS ports completely. | ||
+ | |||
+ | ==== Resolution ==== | ||
+ | |||
+ | To work around this issue, access to a trusted resolver is provided using an SSH tunnel; assuming that SSH can be used, and the IP address of the secure server is known so that setting up the tunnel is not dependent on the resolver. | ||
+ | |||
+ | If TLS is not required: | ||
+ | |||
+ | <file bash / | ||
+ | ... | ||
+ | server: | ||
+ | tcp-upstream: | ||
+ | do-not-query-localhost: | ||
+ | |||
+ | forward-zone: | ||
+ | forward-tls-upstream: | ||
+ | forward-addr: | ||
+ | ... | ||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | </ | ||
+ | |||
+ | |||
+ | If TLS will be used for all upstream resolvers: | ||
+ | |||
+ | <file bash / | ||
+ | server: | ||
+ | do-not-query-localhost: | ||
+ | |||
+ | forward-zone: | ||
+ | forward-tls-upstream: | ||
+ | forward-addr: | ||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | |||
+ | TLS must be properly configured for the secure remote resolver being accessed through the SSH tunnel and your local certificate authority bundle must include the certificate of the authority that issued your TLS certificate. | ||
+ | |||
+ | |||
+ | This example uses: | ||
+ | |||
+ | * server-name.tld is a name compatible with the certificate. | ||
+ | * An SSH tunnel exists from localhost@11853 to the remote secure server’s port 853. | ||
</ | </ | ||
networking/dns/unbound/configure_encrypted_dns_with_caching.1607252982.txt.gz · Last modified: 2020/12/06 11:09 by peter