LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 2060|回复: 17

我的DNS哪里有问题

[复制链接]
发表于 2005-3-21 12:55:04 | 显示全部楼层 |阅读模式
Debian Sarge 系统
单机 + ADSL
主要想学习 DNS 的配置.

仿照精华帖DNS--redhat9 :终于干了你:看后不会都难:《配置篇》,但不太成功,无法解析 www.hello.tm.请帮忙看看哪里不对.

eth0 192.168.5.1
想要在本机上解析 dns.hello.tm 和 www.hello.tm 两个域名到 eth0.

/etc/hosts
127.0.0.1 localhost ....
192.168.5.1 dns.hello.tm
192.168.5.1 www.hello.tm
/etc/hostname
HOSTNAME=dns.hello.tm
#hostname dns.hello.tm

/etc/resolv.conf
nameserver 192.168.5.1
domain hello.tm
/etc/bind/named.conf
include "/etc/bind/named.conf.options";

zone "." {
        type hint;
        file "/etc/bind/db.root";
};

zone "localhost" {
        type master;
        file "/etc/bind/db.local";
};

zone "127.in-addr.arpa" {
        type master;
        file "/etc/bind/db.127";
};

zone "0.in-addr.arpa" {
        type master;
        file "/etc/bind/db.0";
};

zone "255.in-addr.arpa" {
        type master;
        file "/etc/bind/db.255";
};

include "/etc/bind/named.conf.local";

以下手动添加
zone "hello.tm" {
type master;
file "hello.tm.zone";
};

zone "5.168.192.in-addr.arpa"
type master;
file "192.168.5.zone";
};
/etc/bind/hello.tm.zone
$TTL 86400
$ORIGIN hello.tm.
hello.tm. IN SOA dns.hello.tm. root.dns.hello.tm. (
1 ; serial
28800 ; refresh
7200 ; retry
604800 ; expire
86400 ; ttl
)

IN NS dns.hello.tm.

dns IN A 192.168.5.1
www IN A 192.168.5.1
发表于 2005-3-21 14:00:24 | 显示全部楼层
你的最下面一行应该只是

www IN  A 192.168.5.1
回复 支持 反对

使用道具 举报

发表于 2005-3-21 14:03:56 | 显示全部楼层
如果是让internet上访问你的域名 www.hello.tm :是肯定不行的,因为这个域没有在internet注册。
(注册需要去提供DNS域名的网站申请,要钱的)
如果是内部,你想其他windows能够ping到,就要那台dns设置192.168.5.1 ,
另外,好像你管理员 root.dns.happy.tm. 好像写错了吧,不过不影响解析, 应是:root.dns.hello.tm.
测试前先吧iptables关掉。也许里面有限制, service iptables off  , 以后配置其他服务也最好先关掉iptables,除非你精通iptalbes配置(防火墙),再试试吧
回复 支持 反对

使用道具 举报

发表于 2005-3-21 17:54:03 | 显示全部楼层
启动日志怎么说
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-3-21 18:40:58 | 显示全部楼层
现在不能解析 dns.hello.tm 和 www.hello.tm, apache 只能访问 localhost.
但可以 ping 通 localhost, 192.168.5.1, dns.hello.tm 和 www.hello.tm

谢谢 benxiong angelsss 和 Snoopy!

开机启动程序我紧保留了 acpid 和 syslogd.
我还不知道在哪里看关于bind 的日志
回复 支持 反对

使用道具 举报

发表于 2005-3-21 20:08:22 | 显示全部楼层
能ping dns.hello.tm 应该说明你解析可以的。
那也许是你httpd.conf配置有问题吧,或者其他,
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-3-21 21:38:49 | 显示全部楼层
ServerType standalone
ServerRoot /etc/apache
LockFile /var/lock/apache.lock
PidFile /var/run/apache.pid
ScoreBoardFile /var/run/apache.scoreboard
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
MinSpareServers 5
MaxSpareServers 10
StartServers 5
MaxClients 150
MaxRequestsPerChild 100
Include /etc/apache/modules.conf

<IfModule mod_status.c>
  ExtendedStatus On
</IfModule>

Port 80

User www-data
Group www-data

ServerAdmin webmaster@localhost

ServerName localhost

DocumentRoot /var/www

<Directory />
    Options SymLinksIfOwnerMatch
    AllowOverride None
</Directory>

<Directory /var/www/>
    Options Indexes Includes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

<IfModule mod_userdir.c>
    UserDir public_html
    <Directory /home/*/public_html>
        AllowOverride FileInfo AuthConfig Limit
        Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
        <Limit GET POST OPTIONS PROPFIND>
            Order allow,deny
            Allow from all
        </Limit>
        <Limit PUT DELETE PATCH PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>
            Order deny,allow
            Deny from all
        </Limit>
    </Directory>
</IfModule>

<IfModule mod_dir.c>
    DirectoryIndex index.html index.htm index.shtml index.cgi index.php
</IfModule>

AccessFileName .htaccess

<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
</Files>

UseCanonicalName Off

TypesConfig /etc/mime.types

DefaultType text/plain

<IfModule mod_mime_magic.c>
    MIMEMagicFile /usr/share/misc/file/magic.mime
</IfModule>

HostnameLookups Off

ErrorLog /var/log/apache/error.log
LogLevel warn
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{forensic-id}n\" %T %v" full
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{forensic-id}n\" %P %T" debug
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{forensic-id}n\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{forensic-id}n\"" forensic
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

CustomLog /var/log/apache/access.log combined

<IfModule mod_log_forensic.c>
ForensicLog /var/log/apache/forensic.log
</IfModule>

<IfModule mod_backtrace.c>
EnableExceptionHook On
</IfModule>

<IfModule mod_whatkilledus.c>
EnableExceptionHook On
</IfModule>

ServerSignature On

<IfModule mod_alias.c>
    Alias /icons/ /usr/share/apache/icons/

    <Directory /usr/share/apache/icons>
         Options Indexes MultiViews
         AllowOverride None
         Order allow,deny
         Allow from all
    </Directory>

    Alias /images/ /usr/share/images/

    <Directory /usr/share/images>
         Options MultiViews
         AllowOverride None
         Order allow,deny
         Allow from all
    </Directory>
</IfModule>

<IfModule mod_alias.c>
    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/

    <Directory /usr/lib/cgi-bin/>
        AllowOverride None
        Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>
</IfModule>

<IfModule mod_autoindex.c>
    IndexOptions FancyIndexing NameWidth=*
    AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
    AddIconByType (TXT,/icons/text.gif) text/*
    AddIconByType (IMG,/icons/image2.gif) image/*
    AddIconByType (SND,/icons/sound2.gif) audio/*
    AddIconByType (VID,/icons/movie.gif) video/*
    AddIcon /icons/binary.gif .bin .exe
    AddIcon /icons/binhex.gif .hqx
    AddIcon /icons/tar.gif .tar
    AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
    AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
    AddIcon /icons/a.gif .ps .ai .eps
    AddIcon /icons/layout.gif .html .shtml .htm .pdf
    AddIcon /icons/text.gif .txt
    AddIcon /icons/c.gif .c
    AddIcon /icons/p.gif .pl .py
    AddIcon /icons/f.gif .for
    AddIcon /icons/dvi.gif .dvi
    AddIcon /icons/uuencoded.gif .uu
    AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
    AddIcon /icons/tex.gif .tex
    AddIcon /icons/bomb.gif core
    AddIcon /icons/deb.gif .deb
    AddIcon /icons/back.gif ..
    AddIcon /icons/hand.right.gif README
    AddIcon /icons/folder.gif ^^DIRECTORY^^
    AddIcon /icons/blank.gif ^^BLANKICON^^
    DefaultIcon /icons/unknown.gif
    ReadmeName README.html
    HeaderName HEADER.html
</IfModule>

<IfModule mod_mime.c>
    AddEncoding x-compress Z
    AddEncoding x-gzip gz tgz
    AddLanguage da .dk
    AddLanguage nl .nl
    AddLanguage en .en
    AddLanguage et .ee
    AddLanguage fr .fr
    AddLanguage de .de
    AddLanguage el .el
    AddLanguage it .it
    AddLanguage ja .ja
    AddCharset ISO-2022-JP .jis
    AddLanguage pl .po
    AddCharset ISO-8859-2 .iso-pl
    AddLanguage pt .pt
    AddLanguage pt-br .pt-br
    AddLanguage lb .lu
    AddLanguage ca .ca
    AddLanguage es .es
    AddLanguage sv .se
    AddLanguage cs .cz

    <IfModule mod_negotiation.c>
        LanguagePriority en da nl et fr de el it ja pl pt pt-br lb ca es sv
    </IfModule>

    AddType application/x-tar .tgz
    AddType image/bmp .bmp
    AddType text/x-hdml .hdml

    <IfModule mod_include.c>
     AddType text/html .shtml
     AddHandler server-parsed .shtml
    </IfModule>
</IfModule>

AddDefaultCharset on

<IfModule mod_setenvif.c>
    BrowserMatch "Mozilla/2" nokeepalive
    BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0

    BrowserMatch "RealPlayer 4\.0" force-response-1.0
    BrowserMatch "Java/1\.0" force-response-1.0
    BrowserMatch "JDK/1\.0" force-response-1.0
</IfModule>

<IfModule mod_perl.c>
  <IfModule mod_alias.c>
   Alias /perl/ /var/www/perl/
  </IfModule>
  <Location /perl>
    SetHandler perl-script
    PerlHandler Apache::Registry
    Options +ExecCGI
  </Location>
</IfModule>

<IfModule mod_alias.c>
Alias /doc/ /usr/share/doc/
</IfModule>

<Location /doc>
  order deny,allow
  deny from all
  allow from 127.0.0.0/255.0.0.0
  Options Indexes FollowSymLinks MultiViews
</Location>

<IfModule mod_proxy.c>
</IfModule>
Include /etc/apache/conf.d
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-3-21 21:43:20 | 显示全部楼层
# nslookup
;; connection timed out; no servers could be reached

sometimes there's something wrong with bind.
# /etc/init.d/bind9 restart
Stopping domain name service: namedrndc: connect failed: connection refused
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-3-22 19:41:39 | 显示全部楼层
顶,希望有人能帮忙解决!
回复 支持 反对

使用道具 举报

发表于 2005-3-24 17:39:37 | 显示全部楼层
$TTL 86400
@ IN SOA dns.hello.tm. root.dns.hello.tm. (
1 ; serial
28800 ; refresh
7200 ; retry
604800 ; expire
86400 ); ttl


@    IN NS dns.hello.tm.

dns IN A 192.168.5.1
www IN A 192.168.5.1

用这个试试
重启named服务后,看看/var/log/messages
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表