Static hostname resolution configuration is done in /etc/hosts.
It looks like dynamic hostname resolution configuration is done using
resolv.conf file. But from what I know, this file is generated
by another utility (See below).
So to do dynamic hostname resolution configuration, I can use nmtui or nmcli utility to add DNS ip address.
Local host use DNS for IP address lookup when local host cannot find
IP specified in /etc/hosts.
Here is resolv.conf for Linux Mint 18:
Code:
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.1.1
search Home
Here is resolv.conf for CentOS 7:
Code:
# Generated by NetworkManager
nameserver 192.168.122.1
From man resolv.conf:
Quote:
....
nameserver Name server IP address
Internet address of a name server that
the resolver should query, either an IPv4 address
(in dot notation), or an IPv6 address in
colon (and possibly dot) notation as per RFC 2373.
... ...
|
Q1: Since the addresses (127.0.1.1 & 192.168.122.1)
in resolv.conf for the above
nameserver directive are local,
how do I locate these nameservers in local host?
From man resolv.conf:
Quote:
... ...
search Search list for host-name lookup.
The search list is normally determined from the
local domain name; by default, it contains
only the local domain name. This may be
changed by listing the desired domain search
path following the search keyword with spaces
or tabs separating the names. Resolver queries
having fewer than ndots dots (default is 1)
in them will be attempted using each component of
the search path in turn until a match is found.
... ...
|
Q2: About directive "
search Home" in resolv.conf,
what is it looking for in
Home directory?
There are only files and directories in Home.
What did I missed?
Thank you.