我用的是虚拟机 虚拟机是自动获取IP的172.21.1.96
service named restart 运行后没有错了,但还是不能解析,因为dhcp还有报错
日志如下:
Jun 25 19:35:49 localhost named[17400]: shutting down: flushing changes
Jun 25 19:35:49 localhost named[17400]: stopping command channel on 127.0.0.1#953
Jun 25 19:35:49 localhost named[17400]: no longer listening on 127.0.0.1#53
Jun 25 19:35:49 localhost named[17400]: no longer listening on 172.21.1.96#53
Jun 25 19:35:49 localhost named[17400]: exiting
Jun 25 19:35:49 localhost named: succeeded
Jun 25 19:35:51 localhost named[17581]: starting BIND 9.2.4 -u named -t /var/named/chroot
Jun 25 19:35:51 localhost named[17581]: using 1 CPU
Jun 25 19:35:51 localhost named: named 启动 succeeded
Jun 25 19:35:51 localhost named[17581]: loading configuration from '/etc/named.conf'
Jun 25 19:35:51 localhost named[17581]: listening on IPv4 interface lo, 127.0.0.1#53
Jun 25 19:35:51 localhost named[17581]: listening on IPv4 interface eth0, 172.21.1.96#53
Jun 25 19:35:51 localhost named[17581]: command channel listening on 127.0.0.1#953
Jun 25 19:35:51 localhost named[17581]: zone 0.in-addr.arpa/IN: loaded serial 42
Jun 25 19:35:51 localhost named[17581]: zone 0.0.127.in-addr.arpa/IN: loading master file trytest.ddns.ip: file not found
Jun 25 19:35:51 localhost named[17581]: zone 255.in-addr.arpa/IN: loaded serial 42
Jun 25 19:35:51 localhost named[17581]: zone 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa/IN: loaded serial 1997022700
Jun 25 19:35:51 localhost named[17581]: zone trytest.com/IN: loading master file trytest.com: file not found
Jun 25 19:35:51 localhost named[17581]: zone localdomain/IN: loaded serial 42
Jun 25 19:35:51 localhost named[17581]: running
servcie dhpcd restart 出现错误如下:
[root@localhost etc]# service dhcpd restart
关闭 dhcpd:[失败]
启动 dhcpd:Internet Systems Consortium DHCP Server V3.0.1
Copyright 2004 Internet Systems Consortium.
All rights reserved.
For info, please visit
http://www.isc.org/sw/dhcp/
Wrote 0 deleted host decls to leases file.
Wrote 0 new dynamic host decls to leases file.
Wrote 0 leases to leases file.
No subnet declaration for eth0 (172.21.1.96).
** Ignoring requests on eth0. If this is not what
you want, please write a subnet declaration
in your dhcpd.conf file for the network segment
to which interface eth0 is attached. **
Not configured to listen on any interfaces!
我的dhcpd.conf 如下
[root@localhost etc]# cat dhcpd.conf
# 指时实现动态DNS的方法
ddns-update-style interim;
ignore client-updates;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.10 192.168.1.254;
option broadcast-address 192.168.1.255;
}
# --- Option para
option routers 192.168.1.1;
option subnet-mask 255.255.255.0;
option nis-domain "domain.org";
option domain-name "trytest.com";
option domain-name-servers 127.0.0.1;
default-lease-time 600;
max-lease-time 800;
# option time-offset -18000; # Eastern Standard Time
# option ntp-servers 127.0.0.1;
# option netbios-name-servers 127.0.0.1;
# --- Selects point-to-point node (default is hybrid). Don't change this unless
# -- you understand Netbios very well
# option netbios-node-type 2;
# range dynamic-bootp 192.168.1.128 192.168.1.254(orange);
# we want the nameserver to appear at a fixed address
host ns {
next-server marvin.redhat.com;
hardware ethernet 12:34:56:78:AB:CD;
fixed-address 207.175.42.254;
}
# 算法函数
key myddns {
# 指明生成密钥的算法
algorithm HMAC-MD5.SIG-ALG.REG.INT;
# 指明密钥
secret VbJf6KC3Q4eU2KeFGopFhQ==;
}
zone trytest.com.{
primary 127.0.0.1;
key myddns;
}
zone 1.168.192.in-addr.arpa.{
primary 127.0.0.1;
key myddns;
}
还有resolv.conf 配置如下
[root@localhost etc]# cat resolv.conf
; generated by /sbin/dhclient-script
nameserve 127.0.0.1
domain trytest.com
search trytest.com