On Tue, Jul 25, 2017 at 02:58:29PM -0400, Roland C. Dowdeswell wrote: > On Tue, Jul 25, 2017 at 08:45:44AM -0700, Russ Allbery wrote: > > Eh? I *absolutely* would expect that and would consider it a bug if it > > did not. It is incredibly useful for testing to be able to temporarily > > override the IP address of a host in /etc/hosts, and I expect all software > > to honor that. > > SRV RRs are essentially a generalisation of CNAMEs or perhaps MX records.
We can also say SRV are a more elegant expression of the main DNS purpose: to map service names to endpoints. (This was historically inconsistently done by static allocation of service port numbers combined with collective naming of _sets_ of services aka hostnames, the result complemented by the regrettably incomplete solutions like MX and AFSDB. Thus, SRV RRs are a great step forward.) > It is counter-intuitive to expect that /etc/hosts will interpose in the > middle of a lookup. I second Russ and do not agree with you on this point. Given that SRV records as a matter of fact are defined via A[AAA] records, (and given that A lookups historically _are_ interposed by /etc/hosts) what says that /etc/hosts are to be ignored if an A lookup happens as a consequence of an SRV one? > As you can see, getaddrinfo(3) will only use DNS to chase the CNAME > defined in DNS and does not consult /etc/hosts in the middle of a You refer to a certain implementation which is not a specification by itself. What do the applicable standards say? Regards, Rune