Differences between revisions 1 and 6 (spanning 5 versions)
Revision 1 as of 2020-11-10 04:05:57
Size: 1799
Comment:
Revision 6 as of 2023-06-22 20:33:54
Size: 845
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
= resolv.conf = = Resolv.Conf =

The '''resolver configuration file''' (or '''`resolv.conf(5)`'''), typically found at `/etc/resolv.conf`, configures the [[Linux/DNS#Resolver|DNS resovler]].
Line 12: Line 14:
passwd: compat
group: compat
shadow: compat
hosts: dns [!UNAVAIL=return] files
networks: nis [NOTFOUND=return] files
ethers: nis [NOTFOUND=return] files
protocols: nis [NOTFOUND=return] files
rpc: nis [NOTFOUND=return] files
services: nis [NOTFOUND=return] files
nameserver 8.8.8.8
search lan
Line 29: Line 24:
=== Databases === The resolver configuration file primariliy consists of two directives: '''`nameserver`''' and '''`search`''' (as in 'search domain').
Line 31: Line 26:
The first column (delimited by spaces or tab characters) indicates a database, while every subsequent column is a source. Some common database sources are listed below. Up to three `nameserver` directives can be used. These servers are queried for DNS lookups.
Line 33: Line 28:
For `hosts`...
 * `files` (i.e. `/etc/hosts`)
 * `dns` (i.e. run-time lookups based on `/etc/resolv.conf`)
 * `myhostname` (see `nss-myhostname(8)`)
 * `mymachine` which connects to `systemd-machined` (see `nss-mymachines(8)`)
 * `resolve` which connects to `systemd-resolved` (see `nss-resolve(8)`)
The `search` directive sets '''search domains'''. As an example, when querying for `myhost`, `resolver(5)` will append each search domain to that name and query for those as well.
Line 44: Line 34:
=== Action Items === == See also ==
Line 46: Line 36:
'''Action items''' follow one the following patterns: `[STATUS=ACTION]` and `[!STATUS=ACTION]`.

`STATUS` can be any of...
 * `success` meaning 'no error'.
 * `notfound` meaning 'error in lookup'.
 * `unavail` indicates a connection couldn't be made.
 * `tryagain` indicates 'temporarily unavailability', as with locked connections.

`ACTION` can be any of...
 * `return` meaning 'return the result'
 * `continue` meaning 'try the next item'
 * `merge` causes the system to try both the preceding and the following items, and

By default, only a `success` status results in a `return` action. Anything else will result in a `continue`. The exception is for a `group` lookup-a `notfound` status will lead to a `continue` action regardless of any action specified.
[[https://man.archlinux.org/man/resolv.conf.5|resolv.conf(5)]]

Resolv.Conf

The resolver configuration file (or resolv.conf(5)), typically found at /etc/resolv.conf, configures the DNS resovler.


Example

nameserver 8.8.8.8
search lan


Syntax

The resolver configuration file primariliy consists of two directives: nameserver and search (as in 'search domain').

Up to three nameserver directives can be used. These servers are queried for DNS lookups.

The search directive sets search domains. As an example, when querying for myhost, resolver(5) will append each search domain to that name and query for those as well.


See also

resolv.conf(5)


CategoryRicottone

Linux/ResolvConf (last edited 2023-06-22 20:33:54 by DominicRicottone)