What is a scoped DNS query?

13

3

In Mac OS X (Mavericks) I see multiple resolvers, and I don't understand the difference between scoped and non-scoped DNS query resolvers as displayed below:

$ scutil --dns
DNS configuration

resolver #1
  search domain[1] : test
  nameserver[0] : 172.31.30.10
  flags    : Request A records
  reach    : Reachable

.... <arpa stuff snipped> ...
resolver #6
  domain   : 9.e.f.ip6.arpa
  options  : mdns
  timeout  : 5
  flags    : Request A records
  order    : 300600

DNS configuration (for scoped queries) 

resolver #1
  search domain[0] : test
  nameserver[0] : 172.31.30.10
  if_index : 4 (en0)
  flags    : Scoped, Request A records
  reach    : Reachable

PnotNP

Posted 2014-03-26T23:57:40.867

Reputation: 263

Answers

11

Briefly speaking, a scoped DNS query can use only specified network interfaces (e.g. Ethernet or WiFi), while non-scoped can use any available interface.

More verbosely, an application that wants to resolve a name, sends a request (either scoped or non-scoped) to a resolver (usually a DNS client application), if the resolver does not have the answer cached, it sends a DNS query to a particular nameserver (and this goes through one interface, so it is always "scoped").

In your example resolver #1 "for scoped queries" can use only en0 interface (Ethernet).

mik

Posted 2014-03-26T23:57:40.867

Reputation: 318

So the application decides whether to make the query scoped or nonscoped? What is the default behavior, and/or which would dig or a web browser use? – Keith Bennett – 2018-01-31T04:16:52.537

An application like a web browser most probably queries the meta-resolver, which routes the queries to different resolvers according to rules described in resolver(5) manpage. Applications like dig or host make the queries directly to nameservers, not using the Mac OS X DNS query routing mechanism. – mik – 2018-02-02T23:42:03.553