-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathdns-start.html
154 lines (142 loc) · 4.93 KB
/
dns-start.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>1.4. 启动 DNS</title>
<link rel="stylesheet" href="/stylesheets/master.css" type="text/css">
<link rel="stylesheet" href="/stylesheets/syntax.css" type="text/css">
<link rel="stylesheet" href="/docbook/includes/css/docbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.72.0">
<link rel="start" href="index.html" title="DNS 配置示例">
<link rel="up" href="dnssetup.html" title="1. BIND安装">
<link rel="prev" href="dns-conf.html" title="1.3. 配置 DNS">
<link rel="next" href="dnstest.html" title="2. 测试">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<script language="javascript" type="text/javascript" src="/docbook/includes/js/header.js"></script><script language="javascript"> write_header("/docbook"); </script><div class="navheader">
<table width="100%" summary="Navigation header">
<tr><th colspan="3" align="center">1.4. 启动 DNS</th></tr>
<tr>
<td width="20%" align="left">
<a accesskey="p" href="dns-conf.html"><img src="/docbook/includes/images/docbook/prev.png" alt="上一页"></a> </td>
<th width="60%" align="center">1. BIND安装</th>
<td width="20%" align="right"> <a accesskey="n" href="dnstest.html"><img src="/docbook/includes/images/docbook/next.png" alt="下一页"></a>
</td>
</tr>
</table>
<hr>
</div>
<div class="sect2" lang="zh-cn">
<div class="titlepage"><div><div><h3 class="title">
<a name="dns-start"></a>1.4. 启动 DNS</h3></div></div></div>
<p>
创建启动文件 <code class="filename">/etc/rc.d/inet.d/named</code>
</p>
<pre class="screen">
#!/bin/sh
#
# named This shell script takes care of starting and stopping
# named (BIND DNS server).
#
# chkconfig: 345 55 45
# description: named (BIND) is a Domain Name Server (DNS) \
# that is used to resolve host names to IP addresses.
# probe: true
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
[ -f /usr/sbin/named ] || exit 0
[ -f /etc/named.conf ] || exit 0
# See how we were called.
case "$1" in
start)
# Start daemons.
echo -n "Starting named: "
daemon named
echo
touch /var/lock/subsys/named
;;
stop)
# Stop daemons.
echo -n "Shutting down named: "
killproc named
rm -f /var/lock/subsys/named
echo
;;
status)
/usr/sbin/rndc status
exit $?
;;
restart)
/usr/sbin/rndc restart
exit $?
;;
reload)
/usr/sbin/rndc reload
exit $?
;;
probe)
# named knows how to reload intelligently; we don't want linuxconf
# to offer to restart every time
/usr/sbin/rndc reload >/dev/null 2>&1 || echo start
exit 0
;;
*)
echo "Usage: named {start|stop|status|restart}"
exit 1
esac
exit 0
</pre>
<p>
创建 symbollink
</p>
<pre class="screen">
$ ln -s /etc/rc.d/init.d/named /etc/rc.d/rc0.d/K45named
$ ln -s /etc/rc.d/init.d/named /etc/rc.d/rc1.d/K45named
$ ln -s /etc/rc.d/init.d/named /etc/rc.d/rc2.d/K45named
$ ln -s /etc/rc.d/init.d/named /etc/rc.d/rc3.d/S55named
$ ln -s /etc/rc.d/init.d/named /etc/rc.d/rc4.d/S55named
$ ln -s /etc/rc.d/init.d/named /etc/rc.d/rc5.d/S55named
$ ln -s /etc/rc.d/init.d/named /etc/rc.d/rc6.d/K45named
</pre>
<p>
启动
</p>
<pre class="screen">
$ tail -f /var/log/message &
$ /etc/rc.d/init.d/named start
</pre>
</div>
<table class="copyright" border="0" cellpadding="0" cellspacing="0" width="100%">
<col width="33%">
<col width="33%">
<col width="33%">
<tr>
<td></td>
<td align="center" valign="center"></td>
<td align="right" valign="center"><p class="copyright">
Copyright © 2006 <a href="http://www.worldhello.net/doc/"><b>WorldHello 开放文档之源</b> 计划</a></p></td>
</tr>
</table>
<div class="navfooter">
<hr>
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left">
<a accesskey="p" href="dns-conf.html"><img src="/docbook/includes/images/docbook/prev.png" alt="上一页"></a> </td>
<td width="20%" align="center"><a accesskey="u" href="dnssetup.html"><img src="/docbook/includes/images/docbook/up.png" alt="上一级"></a></td>
<td width="40%" align="right"> <a accesskey="n" href="dnstest.html"><img src="/docbook/includes/images/docbook/next.png" alt="下一页"></a>
</td>
</tr>
<tr>
<td width="40%" align="left" valign="top">1.3. 配置 DNS </td>
<td width="20%" align="center"><a accesskey="h" href="index.html"><img src="/docbook/includes/images/docbook/home.png" alt="首页"></a></td>
<td width="40%" align="right" valign="top"> 2. 测试</td>
</tr>
</table>
</div>
<script language="javascript" type="text/javascript" src="/docbook/includes/js/footer.js"></script><script language="javascript"> write_footer("/docbook"); </script>
</body>
</html>