Moxa TC-6110-T-LX [30/117] Hostname your preferred hostname

Moxa TC-6110-T-LX [30/117] Hostname your preferred hostname
TC-6110 Linux User's Manual Managing Communications
3-12
the hostname, which can only contain the ascii characters a through z, the numbers 0 through 9, and a hyphen.
Hostnames must not include dots (periods), because the hostname is used as part of a fully qualified URL.
1. To change the hostname, use the following command:
moxa@MOXA:~# sudo echo ”your-preferred-hostname” > /etc/hostname
2. Load the new hostname:
moxa@MOXA:~# sudo /etc/init.d/hostname.sh start
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

Содержание

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

Скачать