It's a classic case...should the software follow the spec, or the real-world usage? And people complain either way.
It's a classic case...should the software follow the spec, or the real-world usage? And people complain either way.
A common use for this behavior is VPNs: you sign onto a VPN, and the VPN's DNS server gets prepended to the list in resolv.conf, which allows you to resolve internal addresses (and still fall back to your regular DNS). This is a crazy-common use case, and it's incredibly arrogant of Poettering to just dismiss it out of hand, or even attempt to argue with it.
It looks like systemd-resolved implements something similar: https://www.freedesktop.org/software/systemd/man/systemd.net...
The fact that there is an incredibly common use case that consists of an unreliable workaround for people who don't have a local resolver that does this correctly is hardly reason to avoid writing a local resolver that works correctly.
Really? My local DNS server should return the same results as 8.8.8.8? Should one never use unregistered suffixes?
* http://jdebp.eu./FGA/dns-client-all-proxies-must-provide-sam...
And no, you shouldn't just blithely assume that you own parts of the DNS namespace that you do not, either. There are plenty of other people's mistakes to learn from here. Don't repeat them.
* http://jdebp.eu./FGA/dns-use-domain-names-that-you-own.html
I don't have a strong position on that argument. Just trying to state it more clearly.
What one should do is only choose DNS servers capable of properly resolving all addresses, as it shouldn’t be the resolver’s responsibility to “shop around” for answers.
Fixing VPN configurations that complicate this should be the responsibility of VPN client software — by providing a forwarding DNS server that falls back to the originally configured servers, say — not the resolver, and similarly for any other cases where standard resolver behavior does not suffice.
Application software, for its part, shouldn’t generally rely on implementation-defined resolver behavior, as doing so is obviously not portable, but that’s less sinful than a VPN relying on client library-level support to work around the fact that it’s exposing a broken network configuration.
Note that I have no axe to grind one way or another in the systemd debate: Linux isn’t me primary OS, but I regularly use and abuse both systemd and non-systemd Linux systems, and all the Linux init systems seem to work at least as well as any other system I regularly use (OS X, FreeBSD, Windows) for most practical purposes.
Strictly speaking, what you are talking about here, in RFC 1034 terminology, is a "stub resolver", the Unix model where there's a fairly dumb DNS client library running in the applications, talking to an external program that actually does the grunt work of query resolution by making back-end transactions and building up the front-end response from them.
A "resolver" actually very much does "shop around for answers", amongst content DNS servers. There's even a (slightly faulty) description of its shopping around algorithm, in RFC 1034 section 5.3.3.
"resolver" is such a confusing term, and so often used contrary to the RFCs in the way that you have here, that years ago I took to explaining the DNS to people using terminology borrowed from HTTP: proxy servers, content servers, and client libraries linked into applications.
If they're internal services the namespace and the trust heirarchy can be private just fine.
Running your own CA works but has two caveats: first, I don't really trust myself to run a CA competently given that almost nobody who runs a CA as their only business function is doing so competently, and second, you have to get your config onto every device on the network. If you let personal devices on the network or even just hard-to-configure things like Chromecasts, you have to get your config onto all of them somehow.
It's quite a bit simpler and more secure to just use .corp.example.com or whatever.
Sure, it's most suitable for a homelab where you can import the certs, with suitable discretion, for yourself only.
>Running your own CA works but has two caveats: first, I don't really trust myself to run a CA competently given that almost nobody who runs a CA as their only business function is doing so competently
Not a massive concern since the context is internal only, but I hear you.
>and second, you have to get your config onto every device on the network.
Yep, this can be tricky in a less controlled environment. I had two scenarios in my mind - Home lab, and enterprise, when I penned that response. There's definitely a third one here, that you have in mind, that I didn't cover.
>It's quite a bit simpler and more secure to just use .corp.example.com or whatever.
Definitely the best option for small to medium companies.
You don't have to deal with any of the issues of public CAs because you control all the machines, running one in a corporate environment is no issue at all and there are plenty of existing products that will do almost all of the work for you.
> you have to get your config onto every device on the network
Which is a single task in an Ansible playbook, Puppet module, or Task in the Windows Task Sequence.
> you have to get your config onto all of them somehow
Usually not, you just need to get your CA on all the devices that are going to connect to your hosted services.
If you have an internal DNS resolver which handles some private DNS entries, you should not set up any client with that resolver AND a second resolver which does not also have those entries.
So what the OP it's saying is that the example you provided is something you should never do.
So to clarify the statement: "all DNS resolvers defined on a given client are expected to return the same results"
If the ordder is predictable, I can do some shadowing: if A is searched before B, I can put some entry into A which blocks certain sites or redirects.
Even if we just have one server A, there is still an order! The recursive DNS search implements that order. Each server in the chain has the option to return its own local result, which doesn't have to coincide with the next server that is used.
So, that is to say, DNS is implicitly ordered from the leaf server you're using up to the root one.
* http://jdebp.eu./FGA/dnstracer-incorrect-algorithm.html
There is not a "chain" of servers, each passing on queries to the next one along. There is a resolving proxy DNS server that takes a front-end query, makes a bunch of back-end query+response transactions with content DNS servers, and stiches their results together to make the final front-end response.
* http://jdebp.eu./FGA/dns-query-resolution.html
The aforementioned DNS client library can be given the IP addresses of multiple such resolving proxy DNS servers, but there has not been one single conventional order of querying them for far longer than systemd has been around. Different DNS client libraries do it in different ways. nslookup's internal DNS client library does something different to the ISC DNS client library that forms part of many C libraries, as I have already pointed out in this discussion.
The whole "chain of servers" model is one of the commonest misunderstandings of the DNS, in my personal fairly long experience of people with DNS problems. It is quite wrong.
First of all, DNS queries are usually made with UDP. There is no ack or retransmission with UDP, and the network stack is free to drop messages if necessary, such as if a queue fills up or the network is congested. (Hence it has the nickname "Unreliable Datagram Protocol".)
Second, "man resolv.conf" has this to say about what happens when you have multiple DNS servers listed: "The algorithm used is to try a name server, and if the query times out, try the next, until out of name servers, then repeat trying all the name servers until a maximum number of retries are made."
Consider what happens when you combine those two together. You roll the dice and send a UDP request to the first server. Then it rolls the dice by sending a UDP response to you. If that doesn't work, you send to the second server. If that doesn't work, then you try the first server again.
TLDR: In the case of lost packets, which you must assume happen because it's UDP, it alternates between servers. The only thing that's guaranteed is which one comes up in the rotation first.
So much for CDNs or internal networks then.
Better?
Is that assumption true anymore, given a world where some ISPs issue redirection for unfindable domain name[1]?
EDIT: Also, Comcast shut down their Domain Helper as it is fundamentally incompatible with DNSSEC
http://corporate.comcast.com/comcast-voices/comcast-domain-h...