opengnsys_ipxe/src/net
Michael Brown 2acdc92994 [dns] Always start DNS queries using the first configured DNS server
We currently define the active DNS server as a global variable.  All
queries will start by attempting to contact the active DNS server, and
the active DNS server will be changed only if we fail to get a
response.  This effectively treats the DNS server list as expressing a
weak preference ordering: we will try servers in order, but once we
have found a working server we will stick with that server for as long
as it continues to respond to queries.

Some sites are misconfigured to hand out DNS servers that do not have
a consistent worldview.  For example: the site may hand out two DNS
server addresses, the first being an internal DNS server (which is
able to resolve names in private DNS domains) and the second being a
public DNS server such as 8.8.8.8 (which will correctly return
NXDOMAIN for any private DNS domains).  This type of configuration is
fundamentally broken and should never be used, since any DNS resolver
performing a query for a name within a private DNS domain may obtain a
spurious NXDOMAIN response for a valid private DNS name.

Work around these broken configurations by treating the DNS server
list as expressing a strong preference ordering, and always starting
DNS queries from the first server in the list (rather than maintaining
a global concept of the active server).  This will have the debatable
benefit of converting permanent spurious NXDOMAIN errors into
transient spurious NXDOMAIN errors, which can at least be worked
around at a higher level (e.g. by retrying a download in a loop within
an iPXE script).

The cost of always starting DNS queries from the first server in the
list is a slight delay introduced when the first server is genuinely
unavailable.  This should be negligible in practice since DNS queries
are relatively infrequent and the failover expiry time is short.

Treating the DNS server list as a preference ordering is permitted by
the language of RFC 2132, which defines DHCP option 6 as a list in
which "[DNS] servers SHOULD be listed in order of preference".  No
specification defines a precise algorithm for how this preference
order should be applied in practice: this new approach seems as good
as any.

Requested-by: Andreas Hammarskjöld <junior@2PintSoftware.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-02-23 23:17:05 +00:00
..
80211 [eapol] Replace EAPoL code 2021-01-19 13:01:43 +00:00
infiniband [xsigo] Avoid storing unused uninitialised fields in gateway address 2022-02-16 13:29:53 +00:00
oncrpc [nfs] Rewrite NFS URI handling 2014-05-18 21:53:39 +01:00
tcp [uri] Retain original encodings for path, query, and fragment fields 2021-11-12 09:58:29 +00:00
udp [dns] Always start DNS queries using the first configured DNS server 2022-02-23 23:17:05 +00:00
aoe.c [aoe] Allow AoE device to be described using an EFI device path 2020-10-19 14:45:49 +01:00
arp.c [arp] Validate length of ARP packet 2016-03-12 01:24:03 +00:00
dhcpopts.c [legal] Relicense files under GPL2_OR_LATER_OR_UBDL 2015-03-02 14:50:42 +00:00
dhcppkt.c [legal] Relicense files under GPL2_OR_LATER_OR_UBDL 2015-03-02 14:17:31 +00:00
eap.c [eap] Treat an EAP Request-Identity as indicating a blocked link 2021-01-19 13:01:46 +00:00
eapol.c [eap] Treat an EAP Request-Identity as indicating a blocked link 2021-01-19 13:01:46 +00:00
eth_slow.c [lacp] Ignore (and do not echo) trailing padding on received packets 2020-10-14 14:18:49 +01:00
ethernet.c [ethernet] Avoid false positive Coverity warning 2019-08-17 17:30:09 +01:00
fakedhcp.c [pxe] Populate ciaddr in fake PXE Boot Server ACK packet 2015-09-01 21:24:02 +01:00
fc.c [build] Fix the REQUIRE_SYMBOL mechanism 2015-03-05 00:59:38 +00:00
fcels.c [legal] Relicense files under GPL2_OR_LATER_OR_UBDL 2015-03-02 14:17:31 +00:00
fcns.c [legal] Relicense files under GPL2_OR_LATER_OR_UBDL 2015-03-02 14:17:31 +00:00
fcoe.c [time] Allow timer to be selected at runtime 2017-01-26 08:17:37 +00:00
fcp.c [fcp] Allow Fibre Channel device to be described using an EFI device path 2020-10-22 14:16:55 +01:00
fragment.c [legal] Relicense files under GPL2_OR_LATER_OR_UBDL 2015-03-02 14:17:31 +00:00
icmp.c [legal] Relicense files under GPL2_OR_LATER_OR_UBDL 2015-03-02 14:17:31 +00:00
icmpv4.c [legal] Relicense files under GPL2_OR_LATER_OR_UBDL 2015-03-02 14:17:31 +00:00
icmpv6.c [ipv6] Disambiguate received ICMPv6 errors 2015-05-11 12:45:14 +01:00
infiniband.c [infiniband] Require drivers to specify the number of ports 2021-01-27 01:15:35 +00:00
iobpad.c [legal] Relicense files under GPL2_OR_LATER_OR_UBDL 2015-03-02 14:17:31 +00:00
ipv4.c [ipv4] Accept unicast packets for the local network broadcast address 2017-01-22 09:12:52 +00:00
ipv6.c [ipv6] Allow for multiple routers 2016-07-25 15:20:22 +01:00
ndp.c [ipv6] Defer router discovery timeout while link is blocked 2021-01-19 14:15:56 +00:00
neighbour.c [neighbour] Return success when deferring a packet 2015-05-20 15:29:36 +01:00
netdev_settings.c [netdevice] Add "hwaddr" setting 2017-09-06 10:52:30 +01:00
netdevice.c [netdevice] Ensure driver transmit() and poll() will not be re-entered 2021-04-10 16:53:52 +01:00
nullnet.c [legal] Relicense files under GPL2_OR_LATER_OR_UBDL 2015-03-02 14:17:31 +00:00
pccrc.c [peerdist] Include trimmed range within content information block 2015-07-28 15:22:26 +01:00
pccrd.c [peerdist] Add support for constructing and decoding discovery messages 2015-07-28 16:09:14 +01:00
peerblk.c [peerdist] Limit number of concurrent raw block downloads 2019-08-16 22:19:50 +01:00
peerdisc.c [peerdist] Assume that most recently discovered peer can be reused 2021-06-22 09:45:21 +01:00
peerdist.c [peerdist] Allow PeerDist to be globally enabled or disabled 2019-12-13 14:44:22 +00:00
peermux.c [peerdist] Gather and report peer statistics during download 2017-09-05 23:23:22 +01:00
ping.c [xfer] Remove address family from definition of a socket opener 2020-07-15 18:46:58 +01:00
rarp.c [legal] Relicense files under GPL2_OR_LATER_OR_UBDL 2015-03-02 14:17:31 +00:00
retry.c [retry] Colourise debug output 2015-03-05 11:25:54 +00:00
rndis.c [rndis] Clean up error handling path in register_rndis() 2018-07-09 10:35:57 +01:00
socket.c [legal] Relicense files under GPL2_OR_LATER_OR_UBDL 2015-03-02 14:17:31 +00:00
stp.c [time] Allow timer to be selected at runtime 2017-01-26 08:17:37 +00:00
tcp.c [xfer] Remove address family from definition of a socket opener 2020-07-15 18:46:58 +01:00
tcpip.c [netdevice] Limit MTU by hardware maximum frame length 2017-01-25 14:55:09 +00:00
tls.c [crypto] Allow private key to be specified as a TLS connection parameter 2020-12-15 16:54:06 +00:00
udp.c [xfer] Remove address family from definition of a socket opener 2020-07-15 18:46:58 +01:00
validator.c [x509] Make root of trust a reference-counted structure 2020-12-09 16:45:50 +00:00
vlan.c [vlan] Provide vlan_netdev_rx() and vlan_netdev_rx_err() 2019-04-27 20:25:00 +01:00