Chinaunix首页 | 论坛 | 博客
  • 博客访问: 509832
  • 博文数量: 106
  • 博客积分: 1707
  • 博客等级: 上尉
  • 技术积分: 1109
  • 用 户 组: 普通用户
  • 注册时间: 2009-11-16 11:24
个人简介

从事互联网开发、运营、设计、运维等工作。偏爱底层开发,服务器运维

文章分类

全部博文(106)

文章存档

2016年(3)

2015年(6)

2014年(5)

2013年(11)

2012年(8)

2011年(8)

2010年(34)

2009年(31)

分类: LINUX

2009-11-30 17:33:57

DNS的作用有多么重要,在这就不废话了,就是因为重要,所以进行编译安装比rpm方式安装效果更好点!

(下载源文件包)

[root@centos5 ~]#tar -zxvf bind-9.5.0a6.tar.gz (解压)

[root@centos5 ~]# ls
anaconda-ks.cfg bind-9.5.0a6.tar.gz install.log.syslog
bind-9.5.0a6     install.log

[root@centos5 ~]# cd bind-9.5.0a6 (进入解压出来的目录)

[root@centos5 bind-9.5.0a6]# ./configure --prefix=/usr/local/named --enable-threads --with-dlz-mysql(进行编译,--perfix选项指定安装目录,--enable-threads选项用来打开线程支持以提高服务器性能,--with-dlz-mysql选项用来启用区域的动态加载,适合大型的DNS服务器系统,其他编译选项可输入./configure --help查看)
checking host system type... i686-pc-linux-gnu
checking whether make sets $(MAKE)... yes
checking for ranlib... ranlib
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking for ar... /usr/bin/ar
checking for etags... no
checking for emacs-etags... no
checking for perl5... no
checking for perl... /usr/bin/perl
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for fcntl.h... yes
checking for sys/time.h... yes
checking for unistd.h... yes
checking for sys/sockio.h... no
checking for sys/select.h... yes
checking for sys/param.h... yes
checking for sys/sysctl.h... yes
checking for net/if6.h... no
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for sysctlbyname... no
checking for static inline breakage... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... (cached) yes
checking for size_t... yes
checking for ssize_t... yes
checking for uintptr_t... yes
checking for socklen_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking for long long... yes
checking for struct lifconf... no
checking if unistd.h or sys/types.h defines fd_set... yes
checking whether byte ordering is bigendian... no
checking for OpenSSL library... not found
checking for GSSAPI library... disabled
checking for random device... /dev/random
checking for /dev/random... yes
checking for arc4random... no
checking whether to build with thread support... yes
checking for pthread_create in -lpthread... yes
checking for sigwait... yes
checking for pthread_attr_getstacksize... yes
checking for pthread_attr_setstacksize... yes
checking for sysconf... yes
checking for libxml2 library... no
checking for smf_enable_instance in -lscf... no
checking for flockfile... yes
checking for getc_unlocked... yes
checking whether to build with threads... yes
checking if "gcc" supports -fno-strict-aliasing... yes
checking for catgets... yes
checking for socket in -lsocket... no
checking for inet_ntoa in -lnsl... yes
checking whether to use purify... no
checking for IPv6 structures... yes
checking for Kame IPv6 support... no
checking for in6_addr... yes
checking for in6addr_any... yes
checking for in6addr_loopback... yes
checking for sin6_scope_id in struct sockaddr_in6... yes
checking for in6_pktinfo... yes
checking for struct if_laddrreq... no
checking for struct if_laddrconf... no
checking for inet_ntop with IPv6 support... yes
checking for working inet_pton with IPv6 support... yes
checking for inet_aton... yes
checking for sa_len in struct sockaddr... no
checking for struct msghdr flavor... 4.4BSD
checking for type in_port_t... yes
checking for struct addrinfo... yes
checking for struct rrsetinfo... no
checking for int sethostent... no
checking for int endhostent... no
checking for getnetbyaddr(in_addr_t, ...)... yes
checking for int setnetent... no
checking for int endnetent... no
checking for gethostbyaddr(const void *, size_t, ...)... yes
checking for h_errno in netdb.h... yes
checking for getipnodebyname... no
checking for getnameinfo... yes
checking for getaddrinfo... yes
checking for gai_strerror... yes
checking for getifaddrs in -linet6... no
checking for interface list sysctl... no
checking for correctly declared strsep()... yes
checking for memmove... yes
checking for strtoul... yes
checking for strlcpy... no
checking for strlcat... no
checking sprintf... checking for vsnprintf... yes
checking for strerror... yes
checking printf format modifier for 64-bit integers... ll
checking for chroot... yes
checking linux/capability.h usability... yes
checking linux/capability.h presence... yes
checking for linux/capability.h... yes
checking sys/prctl.h usability... yes
checking sys/prctl.h presence... yes
checking for sys/prctl.h... yes
checking sys/un.h usability... yes
checking sys/un.h presence... yes
checking for sys/un.h... yes
checking for tzset... yes
checking for optarg decarartion... yes
checking for type rlim_t... yes
checking for if_nametoindex... yes
checking architecture type for atomic operations... x86_32
checking compiler support for inline assembly code... gcc
checking for latex... no
checking for pdflatex... no
checking for w3m... no
checking for xsltproc... /usr/bin/xsltproc
checking for xmllint... /usr/bin/xmllint
checking for doxygen... doxygen
checking for docbook/html/docbook.xsl... "not found"
checking for docbook/xhtml/docbook.xsl... "not found"
checking for docbook/manpages/docbook.xsl... "not found"
checking for docbook/html/chunk.xsl... "not found"
checking for docbook/xhtml/chunk.xsl... "not found"
checking for docbook/html/chunktoc.xsl... "not found"
checking for docbook/xhtml/chunktoc.xsl... "not found"
checking for docbook/html/maketoc.xsl... "not found"
checking for docbook/xhtml/maketoc.xsl... "not found"
checking for db2latex/xsl/docbook.xsl... "not found"
checking for db2latex/xsl/figures... not found
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking for setlocale... yes
checking for Postgres DLZ driver... no
checking for MySQL DLZ driver... not found
configure: error: MySQL was not found in any of /usr /usr/local /usr/local/mysql /usr/pkg; use --with-dlz-mysql=/path

(系统中没有找到mysql开发头文件,centos下mysql开发头文件名称是mysql-devel,可以使用yum -y install mysql-devel命令安装)

[root@centos5 bind-9.5.0a6]# ./configure --prefix=/usr/local/named --enable-threads
[root@centos5 bind-9.5.0a6]#make && make install (编译完后进行安装,这个过程比较长,耐心等待下!)

[root@centos5 bind-9.5.0a6]# ls /usr/local/named/ (查看安装完后的目录)
bin etc include lib man sbin var

[root@centos5 ~]# cd /usr/local/named/
[root@centos5 named]# ls
bin etc include lib man sbin var
[root@centos5 named]# sbin/rndc-confgen >./etc/rndc.conf   (使用rndc-confgen命令生成rndc.conf文件,rndc主要用来通过网络控制bind9服务器,在能够控制一台bind服务器前,必须要建立双方的认证机制。)
[root@centos5 named]# cat etc/rndc.conf
# Start of rndc.conf
key "rndc-key" {
        algorithm hmac-md5;
        secret "C9dSzd+STLIquODer1bWmg==";
};

options {
        default-key "rndc-key";
        default-server 127.0.0.1;
        default-port 953;
};
# End of rndc.conf

# Use with the following in named.conf, adjusting the allow list as needed:
# key "rndc-key" {
#       algorithm hmac-md5;
#       secret "C9dSzd+STLIquODer1bWmg==";
# };
#
# controls {
#       inet 127.0.0.1 port 953
#               allow { 127.0.0.1; } keys { "rndc-key"; };
# };
# End of named.conf


[root@centos5 etc]# tail -10 rndc.conf |head -9
# key "rndc-key" {
#       algorithm hmac-md5;
#       secret "C9dSzd+STLIquODer1bWmg==";
# };
#
# controls {
#       inet 127.0.0.1 port 953
#               allow { 127.0.0.1; } keys { "rndc-key"; };
# };
[root@centos5 etc]# tail -10 rndc.conf |head -9 > name.conf (将rndc.conf的倒数第10行到倒数2行的文件重定向到name.conf )

去除这9行前面的#号
[root@centos5 etc]# cat name.conf
key "rndc-key" {
        algorithm hmac-md5;
        secret "C9dSzd+STLIquODer1bWmg==";
};

controls {
        inet 127.0.0.1 port 953
                allow { 127.0.0.1; } keys { "rndc-key"; };
};


[root@centos5 etc]# ../sbin/named -4 (启动named进程)
[root@centos5 etc]# netstat -ntpl   (查看当前活动的TCP端口)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             Stat                                             e       PID/Program name
tcp        0      0 0.0.0.0:741                 0.0.0.0:*                   LIST                                             EN      1831/rpc.statd
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LIST                                             EN      1806/portmap
tcp        0      0 192.168.1.200:53            0.0.0.0:*                   LIST                                             EN      2554/named
tcp        0      0 127.0.0.1:53                0.0.0.0:*                   LIST                                             EN      2554/named
tcp        0      0 127.0.0.1:631               0.0.0.0:*                   LIST                                             EN      2122/cupsd
tcp        0      0 127.0.0.1:953               0.0.0.0:*                   LIST                                             EN      2554/named
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LIST                                             EN      2146/sendmail: acce
tcp        0      0 :::22                       :::*                        LIST                                             EN      2107/sshd

[root@centos5 ~]# nslookup (进行解析测试)
> server localhost
Default server: localhost
Address: 127.0.0.1#53
>
Server:         localhost
Address:        127.0.0.1#53

Non-authoritative answer: (非权威性查询结果)
   canonical name = .
Name:  
Address: 121.14.89.14
Name:  
Address: 121.14.88.14

 

阅读(1797) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~