- 论坛徽章:
- 0
|
我查找手册,发现
11.10.2 主机名
11.10.2.1 /etc/resolv.conf
/etc/resolv.conf 指示了 FreeBSD 如何访问域名系统(DNS)。
resolv.conf 中最常见的记录是:
nameserver 按顺序要查询的名字服务器的 IP 地址,最多三个。
search 搜索机器名的列表。这通常由本地机器名的域决定。
domain 本地域名。
一个典型的 resolv.conf 文件:
search example.com
nameserver 147.11.1.11
nameserver 147.11.100.30
注意: 只能使用一个 search 和 domain 选项。
如果您在使用 DHCP,dhclient( 经常使用从 DHCP 服务器接受来的信息重写 resolv.conf。
11.10.2.2 /etc/hosts
/etc/hosts 是 Internet 早期使用的一个简单文本数据库。 它结合 DNS 和 NIS 提供名字到 IP 地址的映射。 通过局域网连接的机器可以用这个简单的命名方案来替代设置一个 named( 服务器。另外,/etc/hosts 也可以提供一个 Internet 名称的本地纪录以减轻需要从外部查询带来的负担。
# $FreeBSD$
#
#
# Host Database
#
# This file should contain the addresses and aliases for local hosts that
# share this file. Replace 'my.domain' below with the domainname of your
# machine.
#
# In the presence of the domain name service or NIS, this file may
# not be consulted at all; see /etc/nsswitch.conf for the resolution order.
#
#
::1 localhost localhost.my.domain
127.0.0.1 localhost localhost.my.domain
#
# Imaginary network.
#10.0.0.2 myname.my.domain myname
#10.0.0.3 myfriend.my.domain myfriend
#
# According to RFC 1918, you can use the following IP networks for
# private nets which will never be connected to the Internet:
#
# 10.0.0.0 - 10.255.255.255
# 172.16.0.0 - 172.31.255.255
# 192.168.0.0 - 192.168.255.255
#
# In case you want to be able to connect to the Internet, you need
# real official assigned numbers. Do not try to invent your own network
# numbers but instead get one from your network provider (if any) or
# from your regional registry (ARIN, APNIC, LACNIC, RIPE NCC, or AfriNIC.)
请问:
1./etc/resolv.conf文件里面的search example.com 如何填写?我自己的主机名字是sea
2./etc/hosts 如何填写? |
|