.. _dns-forwarding: ############## DNS Forwarding ############## Configuration ============= VyOS provides DNS infrastructure for small networks. It is designed to be lightweight and have a small footprint, suitable for resource constrained routers and firewalls. For this we utilize PowerDNS recursor. The VyOS DNS forwarder does not require an upstream DNS server. It can serve as a full recursive DNS server - but it can also forward queries to configurable upstream DNS servers. By not configuring any upstream DNS servers you also avoid being tracked by the provider of your upstream DNS server. .. cfgcmd:: set service dns forwarding system Forward incoming DNS queries to the DNS servers configured under the ``system name-server`` nodes. .. cfgcmd:: set service dns forwarding dhcp Interfaces whose DHCP client nameservers to forward requests to. .. cfgcmd:: set service dns forwarding name-server
port Send all DNS queries to the IPv4/IPv6 DNS server specified under `
` on optional port specified under ``. The port defaults to 53. You can configure multiple nameservers here. .. cfgcmd:: set service dns forwarding domain name-server
Forward received queries for a particular domain (specified via `domain-name`) to a given nameserver. Multiple nameservers can be specified. You can use this feature for a DNS split-horizon configuration. .. note:: This also works for reverse-lookup zones (``18.172.in-addr.arpa``). .. cfgcmd:: set service dns forwarding domain addnta Add NTA (negative trust anchor) for this domain. This must be set if the domain does not support DNSSEC. .. cfgcmd:: set service dns forwarding domain recursion-desired Set the "recursion desired" bit in requests to the upstream nameserver. .. cfgcmd:: set service dns forwarding allow-from Given the fact that open DNS recursors could be used on DDoS amplification attacks, you must configure the networks which are allowed to use this recursor. A network of ``0.0.0.0/0`` or ``::/0`` would allow all IPv4 and IPv6 networks to query this server. This is generally a bad idea. .. cfgcmd:: set service dns forwarding dnssec The PowerDNS recursor has 5 different levels of DNSSEC processing, which can be set with the dnssec setting. In order from least to most processing, these are: * **off** In this mode, no DNSSEC processing takes place. The recursor will not set the DNSSEC OK (DO) bit in the outgoing queries and will ignore the DO and AD bits in queries. * **process-no-validate** In this mode the recursor acts as a "security aware, non-validating" nameserver, meaning it will set the DO-bit on outgoing queries and will provide DNSSEC related RRsets (NSEC, RRSIG) to clients that ask for them (by means of a DO-bit in the query), except for zones provided through the auth-zones setting. It will not do any validation in this mode, not even when requested by the client. * **process** When dnssec is set to process the behavior is similar to process-no-validate. However, the recursor will try to validate the data if at least one of the DO or AD bits is set in the query; in that case, it will set the AD-bit in the response when the data is validated successfully, or send SERVFAIL when the validation comes up bogus. * **log-fail** In this mode, the recursor will attempt to validate all data it retrieves from authoritative servers, regardless of the client's DNSSEC desires, and will log the validation result. This mode can be used to determine the extra load and amount of possibly bogus answers before turning on full-blown validation. Responses to client queries are the same as with process. * **validate** The highest mode of DNSSEC processing. In this mode, all queries will be validated and will be answered with a SERVFAIL in case of bogus data, regardless of the client's request. .. note:: The popular Unix/Linux ``dig`` tool sets the AD-bit in the query. This might lead to unexpected query results when testing. Set ``+noad`` on the ``dig`` command line when this is the case. .. note:: The ``CD``-bit is honored correctly for process and validate. For log-fail, failures will be logged too. .. cfgcmd:: set service dns forwarding ignore-hosts-file Do not use the local ``/etc/hosts`` file in name resolution. VyOS DHCP server will use this file to add resolvers to assigned addresses. .. cfgcmd:: set service dns forwarding cache-size <0-2147483647> Maximum number of DNS cache entries. 1 million per CPU core will generally suffice for most installations. This defaults to 10000. .. cfgcmd:: set service dns forwarding negative-ttl <0-7200> A query for which there is authoritatively no answer is cached to quickly deny a record's existence later on, without putting a heavy load on the remote server. In practice, caches can become saturated with hundreds of thousands of hosts which are tried only once. This setting, which defaults to 3600 seconds, puts a maximum on the amount of time negative entries are cached. .. cfgcmd:: set service dns forwarding timeout <10-60000> The number of milliseconds to wait for a remote authoritative server to respond before timing out and responding with SERVFAIL. This setting defaults to 1500 and is valid between 10 and 60000. .. cfgcmd:: set service dns forwarding listen-address
The local IPv4 or IPv6 addresses to bind the DNS forwarder to. The forwarder will listen on this address for incoming connections. .. cfgcmd:: set service dns forwarding source-address
The local IPv4 or IPv6 addresses to use as a source address for sending queries. The forwarder will send forwarded outbound DNS requests from this address. .. cfgcmd:: set service dns forwarding no-serve-rfc1918 This makes the server authoritatively not aware of: 10.in-addr.arpa, 168.192.in-addr.arpa, 16-31.172.in-addr.arpa, which enabling upstream DNS server(s) to be used for reverse lookups of these zones. Authoritative zones ------------------- The VyOS DNS forwarder can also be configured to host authoritative records for a domain. .. cfgcmd:: set service dns forwarding authoritative-domain disable Disable hosting authoritative zone for `` without deleting from configuration. .. cfgcmd:: set service dns forwarding authoritative-domain records disable Disable specific record without deleting it from configuration. .. cfgcmd:: set service dns forwarding authoritative-domain records ttl Set the :abbr:`TTL (Time-to-live)` for the record in seconds. Default is 300 seconds. Record types ^^^^^^^^^^^^ Below are a list of record types available to be configured within VyOS. Some records support special `` keywords: * ``@`` Use @ as record name to set the record for the root domain. * ``any`` Use any as record name to configure the record as a wildcard. .. cfgcmd:: set service dns forwarding authoritative-domain records a address Set an :abbr:`A (Address)` record. Supports ``@`` and ``any`` keywords. .. cfgcmd:: set service dns forwarding authoritative-domain records aaaa address Set an :abbr:`AAAA (IPv6 Address)` record. Supports ``@`` and ``any`` keywords. .. cfgcmd:: set service dns forwarding authoritative-domain records cname target Set an :abbr:`CNAME (Canonical name)` record. Supports ``@`` keyword. .. cfgcmd:: set service dns forwarding authoritative-domain records naptr rule