Moxa DA-682A-C7-W7E [30/112] Configuring the dns resolver

Moxa DA-682A-C7-W7E [30/112] Configuring the dns resolver
DA-682A Linux Softrware Managing Communications
3-13
3. Check the new hostname.
moxa@MOXA:~# hostname
your-preferred-hostname
Configuring the DNS Resolver
This is the file most in need of updating when configuring DNS. For example, before using the command
moxa@Moxa:~# ntpdate time.stdtime.gov.tw
to update the system time, you will need to add a DNS server address to the resolver configuration. Ask your
network administrator for addresses to preferred DNS servers. Each servers address is specified by prefacing
the line with nameserver. For example, to add a DNS server with IP address is 168.95.1.1 to
/etc/resolv.conf, you would simply append nameserver 168.95.1.1 to the end of the file.
moxa@MOXA:~#/
etc# echo “nameserver 168.95.1.1” >> resolv.conf
moxa@MOXA:~#/etc# cat resolv.conf
# resolv.conf This file is the resolver configuration file
# See resolver(5).
#
#nameserver 192.168.1.16
nameserver 140.115.1.31
nameserver 140.115.236.10
nameserver 168.95.1.1
Configuring the Name Service Switcher
The name service switcher configuration file is nsswitch.conf; this file defines in what sequence system
databases will be referenced to retrieve name service information when resolving URLs to IP addresses. The
file is plain ASCII text, with columns separated by spaces or tab characters. The first column specifies the
database name. The remaining columns describe the order of sources to query and a limited set of actions that
can be performed by lookup result; the sources will be referenced in the order they appear on the line, from
right to left.
Five service specifications may be indicated for any source: files, db, nis, nisplus, or compat. For the hosts
database, you may also specify dns; compatibility mode (compat) may only be used with the passwd, group,
and shadow databases. Use of the files source will have the name service switcher search the /etc directory
to find a file that matches the source name (e.g., /etc/hosts, /etc/passwd, /etc/group), and then that file will
be used. By omitting dns or files you may effectively disable dns or the local hosts file for URL resolution.
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference’ and `info’ packages installed, try:
# `info libc “Name Service Switch”‘ for information about this file.
passwd: compat
group: compat
shadow: compat
hosts: files dns
networks: files
protocols: db files
services: db files
ethers: db files
rpc: db files

Содержание

Похожие устройства