doh_address
The `doh_address` directive sets the address of the upstream DNS server for processing DNS-over-HTTPS queries in NGINX.
Description
The doh_address directive is part of the NGINX module specifically designed for serving DNS-over-HTTPS (DOH) requests. When this directive is used within a location block, it specifies the address of the upstream DNS server that NGINX will use to resolve DNS queries. The address can be an IPv4 or an IPv6 address, allowing flexibility in configuration depending on the network setup and the availability of DNS resolvers. This directive is crucial for ensuring that all DNS queries are forwarded to the correct upstream server, which will handle the query and respond accordingly.
In conjunction with doh_port and doh_timeout, doh_address helps create an effective communication pathway with the DNS server. If doh_address is not explicitly defined, NGINX defaults to using '127.0.0.1', which refers to a locally running DNS server. Ensuring that the correct address is set is vital for the proper functioning of the DNS service as any misconfiguration can lead to failed DNS queries and potential service disruption.
When the doh_address directive is invoked, the NGINX server makes DNS queries to the specified address when handling incoming HTTP requests for DNS resolution. The behavior can be observed through proper logging of incoming requests, and ensuring the system is able to handle DOH traffic effectively with the configured parameters.
Config Example
location /dns-query {
doh;
doh_address 127.0.2.1;
}Ensure the DNS server address is reachable and correctly configured.
Be cautious of firewalls blocking traffic to the specified DNS server address.
Using an invalid address format will result in configuration errors.