Commit Graph

298 Commits

Author SHA1 Message Date
Simon Kelley
075e4a56b7 --leasequery can now take a subnet argument. 2025-05-14 22:36:03 +01:00
Simon Kelley
48658ebc54 Add address filtering for leasequery. 2025-05-14 22:36:03 +01:00
Simon Kelley
4fbe1add95 Implement RFC-4388 DHCPv4 leasequery. 2025-05-14 22:35:51 +01:00
Simon Kelley
8ddabd11bc DNSSEC validation change for reverse lookups in RFC-1918 ranges and friends.
The large public DNS services seem not to return proof-of-nonexistence
for DS records at the start of RFC-1918 in-addr.arpa domains and the their
IPv6 equivalents. 10.in-addr.arpa, 168.192.in-addr.arpa etc.

Since dnsmasq already has an option which instructs it not bother
upstream servers with pointless queries about these address ranges,
namely --bogus-priv, we extend that to enable behaviour which allows
dnsmasq to assume that insecure NXDOMAIN replies for these domains
are expected and to assume that the domains are legitimately unsigned.

This behaviour only matters when some address range is directed to
another upstream server using --rev-server. In that case it allows
replies from that server to pass DNSSEC validation. Without such a
server configured, queries are never sent upstream so they are never
validated and the new behaviour is moot.
2025-05-09 21:46:50 +01:00
Simon Kelley
e3a2c8dadf Add --log-queries=auth option. 2025-04-20 22:20:52 +01:00
Paul Donald
b0b4d90b6a Multiple typo and spelling fixes. 2025-03-29 21:41:40 +00:00
Simon Kelley
57f0489f38 Redesign the interaction between DNSSEC vaildation and per-domain servers.
This should just work in all cases now. If the normal chain-of-trust exists into
the delegated domain then whether the domain is signed or not, DNSSEC
validation will function normally. In the case the delgated domain
is an "overlay" on top of the global DNS and no NS and/or DS records
exist connecting it to the global dns, then if the domain is
unsigned the situation will be handled by synthesising a
proof-of-non-existance-of-DS for the domain and queries will be
answered unvalidated; this action will be logged. A signed domain
without chain-of-trust can be validated if a suitable trust-anchor
is provided using --trust-anchor.

Thanks to Uwe Kleine-König for prompting this change, and contributing
valuable insights into what could be improved.
2025-03-14 15:12:45 +00:00
Simon Kelley
fc9135ca9f Documentation for --do-0x20-encode. 2025-03-09 16:15:16 +00:00
Simon Kelley
a1a214c393 Bump date on manpage. 2025-02-05 21:34:54 +00:00
Simon Kelley
f31667317d Manpage typo. 2025-02-05 15:20:31 +00:00
Simon Kelley
5226b712a3 Add --no-0x20-encode config option.
The "bit 0x20 encoding" implemented in 995a16ca0c
can interact badly with (hopefully) rare broken upstream servers. Provide
an option to turn it off and a log message to give a clue as to why DNS service
is non-functional.
2025-02-03 21:02:12 +00:00
Paul Donald
046bfa2af0 Clean up some of the man page formatting.
Some writing was improved for clarity, especially regarding the use of
tags which can be confusing and difficult to grasp.
2025-02-01 22:40:54 +00:00
Simon Kelley
a4569c22cc Correct BNF for --trust-anchor in manpage. 2025-01-20 16:20:13 +00:00
Andrew Sayers
7af26eed32 Fix manpage typo.
s/will we/will be/
2025-01-07 21:01:15 +00:00
Simon Kelley
5483fead6a Support PXE proxy-DHCP and DHCP-relay at the same time.
When using PXE proxy-DHCP, dnsmasq supplies PXE information to
the client, which also talks to another "normal" DHCP server
for address allocation and similar. The normal DHCP server may
be on the local network, but it may also be remote, and accessed via
a DHCP relay. This change allows dnsmasq to act as both a
PXE proxy-DHCP server AND a DHCP relay for the same network.
2024-12-05 17:32:13 +00:00
Simon Kelley
7199531ff1 Add --dhcp-option-pxe config.
This acts almost exactly like --dhcp-option except that the defined option
is only sent when replying to PXE clients. More importantly, these
options are sent in reply PXE clients when dnsmasq in acting in PXE
proxy mode. In PXE proxy mode, the set of options sent is defined by
the PXE standard and the normal set of options is not sent. This config
allows arbitrary options in PXE-proxy replies. A typical use-case is
to send option 175 to iPXE. Thanks to Jason Berry for finding the
requirement for this.
2024-12-05 17:07:40 +00:00
Simon Kelley
a8088e331a Modify the behaviour of --synth-domain for IPv6.
When deriving a domain name from an IPv6 address, an address
such as 1234:: would become 1234--.example.com, which is
not legal in IDNA2008. Stop using the :: compression method,
so 1234:: becomes
1234-0000-0000-0000-0000-0000-0000-0000.example.com
2024-11-27 23:12:41 +00:00
Simon Kelley
41d2ae3203 Make the packet-dump code work with a FIFO.
mkfifo /tmp/dnsmasq.pipe
dnsmasq --dumpfile=/tmp/dnsmasq.pipe ....
wireshark -i /tmp/dnsmasq.pipe

gives real-time display of network traffic in Wireshark.
2024-11-27 16:03:13 +00:00
Simon Kelley
4ea23f7ea1 Default --fast-dns-retries on when doing DNSSEC.
When doing DNSSEC validation, a single downstream query may
trigger many upstream queries. On an unreliable network, there
may not be enough downstream retries to ensure that all these
queries complete.
2024-11-24 21:52:39 +00:00
Simon Kelley
d15d371051 Handle truncated response UDP-to-TCP to downstream queries when validating.
A relatively common situation is that the reply to a downstream query
will fit in a UDP packet when no DNSSEC RRs are present, but overflows
when the RRSIGS, NSEC ect are added. This extends the automatic
move from UDP to TCP to downstream queries which get truncated replies,
in the hope that once stripped of the DNSSEC RRs, the reply can be returned
via UDP, nwithout making the downstream retry with TCP.

If the downstream sets the DO bit, (ie it wants the DNSSEC RRs, then
this path is not taken, since the downstream will have to get a truncated
repsonse and retry to get a correct answer.
2024-10-12 22:32:21 +01:00
Simon Kelley
3ae7f1ab0d Add --dnssec-limits option. 2024-02-12 23:11:35 +00:00
Simon Kelley
3de7289bd6 Make --filter-rr=ANY filter the answer to ANY queries.
Thanks to Dominik Derigs for an earlier patch which inspired this.
2024-02-12 20:45:20 +00:00
Justin
aa9e9651a1 Man page typo fix. 2024-01-21 22:24:43 +00:00
Petr Menšík
2748d4e901 Introduce new --local-service=host parameter
Similar to local-service, but more strict. Listen only on localhost
unless other interface is specified. Has no effect when interface is
provided explicitly. I had multiple bugs fillen on Fedora, because I have
changed default configuration to:

interface=lo
bind-interfaces

People just adding configuration parts to /etc/dnsmasq.d or appending to
existing configuration often fail to see some defaults are already there.
Give them auto-ignored configuration as smart default.

Signed-off-by: Petr Menšík <pemensik@redhat.com>

Do not add a new parameter on command line. Instead add just parameter
for behaviour modification of existing local-service option. Now it
accepts two optional values:
- net: exactly the same as before
- host: bind only to lo interface, do not listen on any other addresses
  than loopback.
2024-01-13 22:11:22 +00:00
Damian Sawicki
69877f565a Add information on process-forking for TCP connections to metrics.
Add the relevant information to the metrics and to the output of
dump_cache() (which is called when dnsmasq receives SIGUSR1).
Hence, users not collecting metrics will still be able to
troubleshoot with SIGUSR1. In addition to the current usage,
dump_cache() contains the information on the highest usage
since it was last called.
2023-11-30 15:55:51 +00:00
Damian Sawicki
416390f996 Add --max-tcp-connections option to make this dynamically configurable. 2023-11-04 23:33:28 +00:00
Simon Kelley
aaba66efbd Add --no-dhcpv4-interface and --no-dhcpv6-interface options. 2023-04-12 22:55:14 +01:00
Simon Kelley
c244d92d8a Allow --cache-rr=ANY with the obvious meaning. 2023-03-31 22:45:35 +01:00
Simon Kelley
a3c8b75972 Add filtering of arbitrary RR-types. 2023-03-29 22:43:21 +01:00
Simon Kelley
042c64273d Remove code for caching SRV.
Function replaced by the ability to cache any RR type.

For backwards compatibilty SRV records are always on the
list of cacheable RR-types.
2023-03-28 18:24:22 +01:00
Simon Kelley
eb92fb32b7 Set the default maximum DNS UDP packet size to 1232.
http://www.dnsflagday.net/2020/ refers.

Thanks to Xiang Li for the prompt.
2023-03-07 22:21:21 +00:00
Simon Kelley
7d6b68c5d7 Document suppressing deafult options in --dhcp-option. 2023-03-06 13:06:03 +00:00
Dominik Derigs
e5e8cae1ca Add --no-ident option. 2023-01-23 22:48:01 +00:00
Dominik Derigs
efbf80be58 Make max staleness of stale cache entries configurable and default to one day. 2022-11-26 21:18:34 +00:00
Simon Kelley
207ce40db2 Add /etc/hosts gotcha to man page section for --dhcp-hosts. 2022-11-21 16:53:56 +00:00
Simon Kelley
1db9943c68 Extend specifying DNS servers by domain-name to --rev-server
Also Dbus SetDomainServers method.

Revert getaddrinfo hints.ai_socktype to SOCK_DGRAM to eliminate
duplicating every address three times for DGRAM, STREAM and RAW
in the results.
2022-11-06 21:10:19 +00:00
Dominik Derigs
2d8905dafd Allow domain names as well is IP addresses in --server options. 2022-11-05 11:49:52 +00:00
Simon Kelley
fe9a134baf Add --no-round-robin option. 2022-10-18 16:06:48 +01:00
Dominik Derigs
0017dd74d5 Enhance --hostdir so that records are automatically removed when re-reading.
Initial patch from Dominik Derigs, re-written by Simon Kelley.
2022-10-16 22:10:48 +01:00
Simon Kelley
9a9f6e147c Make fast-retry more configurable and do exponential backoff. 2022-09-15 19:29:49 +01:00
Simon Kelley
d334e7c34f Add --use-stale-cache option. 2022-09-06 22:43:33 +01:00
Simon Kelley
d21438a7df Add --fast-dns-retry option.
This gives dnsmasq the ability to originate retries for upstream DNS
queries itself, rather than relying on the downstream client. This is
most useful when doing DNSSEC over unreliable upstream network. It
comes with some cost in memory usage and network bandwidth.
2022-09-06 22:43:33 +01:00
Simon Kelley
24c3b5b3d4 Add --port-limit option.
By default, when sending a query via random ports to multiple upstream servers or
retrying a query dnsmasq will use a single random port for all the tries/retries.
This option allows a larger number of ports to be used, which can increase robustness
in certain network configurations. Note that increasing this to more than
two or three can have security and resource implications and should only
be done with understanding of those.
2022-09-06 22:43:33 +01:00
Simon Kelley
6134b94c02 Update man page on DHCP data provided to scripts. Provide requested options for DHCPv6 also. 2022-07-31 12:15:38 +01:00
Simon Kelley
a267a9e489 Add the ability to specify destination port in DHCP-relay mode.
This change also removes a previous bug
where --dhcp-alternate-port would affect the port used
to relay _to_ as well as the port being listened on.
The new feature allows configuration to provide bug-for-bug
compatibility, if required. Thanks to Damian Kaczkowski
for the feature suggestion.
2022-05-26 16:40:44 +01:00
Simon Kelley
191924576c Add DNSMASQ_DATA_MISSING envvar to lease-change script. 2022-03-22 13:47:05 +00:00
Simon Kelley
756a1dcc19 Manpage update for --localise-queries.
Thanks to Leonardo Romor for the suggestion.
2022-03-05 18:13:15 +00:00
Simon Kelley
3ab6dd1c37 Enhance --domain to accept, interface names for the address range.
This allows hosts get a domain which relects the interface they
are attached to in a way which doesn't require hard-coding addresses.

Thanks to Sten Spans for the idea.
2022-03-05 18:07:07 +00:00
Simon Kelley
e426c2d3bc Add --conf-script 2022-02-08 12:10:27 +00:00
Simon Kelley
292dfa653e Merge branch 'master' of ssh://thekelleys.org.uk/var/local/git/dnsmasq 2022-02-02 18:31:22 +00:00