ºìÁªLinuxÃÅ»§
Linux°ïÖú

СÐÍÍøÂçÖеÄDNSÉèÖÃ

·¢²¼Ê±¼ä:2005-06-25 00:25:32À´Ô´:ºìÁª×÷Õß:ming
ÉùÃ÷: ´ËÎÄÕµÄÄÚÈÝÈ¡×ÔÆäËûµÄ³ö°æÎï¡¢HOWTO¡¢man Ìáʾ¡¢ÐÂÎÅ×é¡¢ºÍÔÚ¼üÅÌÉÏ ³¤Ê±¼äµÄÊäÈ룬µ«Õâ²¢²»Òâζ´ËƪָÄÏÖоͰüÀ¨ÁËËùÓеÄÏà¹ØÄÚÈÝ£¬¸ü׼ȷµÄ˵ÊǸø³õѧÕß¹ØÓÚ½»»¥½éÖÊ (intermedia)Ò»¿éÇÃÃÅש. ËùÓеÄÀý×ÓÈ¡×ÔÎÒÃǵļÒÓÃСÐÍÍøÂ磬ȷÐÅÊǹ¤×÷Õý³£µÄ£¬

´ËÖ¸ÄϵÄʹÓÃ:

·½À¨ºÅÖеÄÄÚÈÝÏó[ENTER]ÕâÑùµÄÊÇÖ¸°´Ï¼üÅ̵ĸüü»òÕßÊǵã»÷Êó±ê¡£ Ô²À¨ºÅÖеÄÄÚÈÝÏó£¨your name here£©ÕâÑùµÄÊÇÖ¸ÐèÒªÌîÈëʵ¼ÊµÄÊý¾Ý бÌåµÄ×Ö·ûÊÇÖ¸ÒªÔÚÌáʾ·ûÏÂÒªÊäÈëµÄÄÚÈÝ ÏȾöÌõ¼þ: ÔÚ´ËÖ®Ïȼٶ¨ÄãÒÑ°²×°ÁËbind v8.2,²¢ÇÒÄãÑ¡¶¨ÁËÒ»¸öºÏ·¨µÄÓòÃû£¬Ê¹ÓÃIPαװ³ÌÐò ½«Äã»úÆ÷µÄIPµØÖ·¸øÒþ²ØÁË¡£Èç¹ûÄãÓõÄÊÇ bind V4.x½«²»ÄÜÕý³£¹¤×÷,ÄãÓÐÁ½¸öÑ¡Ôñ£¬Ò»ÊÇÉý¼¶(4.xÓа²È«·½ÃæµÄÎÊÌâ)ÁíÍâµÄ¾Í Êdz¬³ö±¾ÎÄËù̽¾¿µÄ·¶Î§ÁË¡£ÐèҪעÒâµÄÊǶàÊýµÄLinux·¢²¼Öаüº¬Èý¸öbind µÄ°ü£¬ ÆäÖС°caching-only¡°µÄ°æ±¾ÊDz»ÐèÒªµÄ¡£ ʲôÊÇ DNS? DNSÊÇDomain Name System(ÓòÃû½âÎö)µÄËõд£¬¶øʵ¼ÊÉÏÊÇÒ»ÖÖЭÒé¡£ËùÒªÓÃµÄ Bind(Berkeley Internet Name Domain)³ÌÐòÊÇͬʱÔËÐÐÔÚ·þÎñÆ÷¶ËºÍ¿Í»§¶ËµÄ£¬ DNSÄܽ«ÎÒÃÇÈËËùÄܹ»Àí½âµÄ×Öĸ-Êý×ÖÐÎʽµÄÃû×Öת»»³É¼ÆËã»úËùÄÜÀí½âµÄIPµØÖ·£¬·´Ö®ÒàÈ»£» »»¶øÑÔÖ®£¬¾ÍÊÇÄܽ«www.netscape.comÕâÑùµÄÐÎʽת»»³É207.200.75.200ÕâÑùµÄIPµØÖ·.

ΪʲôҪÉèÁ¢×Ô¼ºµÄ DNS ·þÎñÆ÷? Æäʵ½ö½öÒÀÀµÓÚISPµÄ·þÎñÆ÷Ò²ÊÇ¿ÉÒԵģ¬ÉèÁ¢×Ô¼ºµÄDNS·þÎñÆ÷¿ÉÒÔ¼ÓËÙÑ°Ö·£¬·½±ã¹ÜÀí£¬ ÔÚÄ¿Ç°ÏÖÓеÄÍøÂç»·¾³ÖÐÌí¼ÓеļÆËã»úÒ²»á±äµÄ¸ü¼ÓÈÝÒ×£¬sendmail»á¹¤×÷µÄ¸üºÃ£¬Áí Íâ¿ÕÓàʱ¼äÒ²ÓиöºÃµÄÏîÄ¿×ö×ö¡£

µ±Ç°ÊÇË­ÌṩµÄDNS·þÎñ? Ò»°ã¶øÑÔ¾ÍÊÇÄãµ±µØµÄISP·þÎñÉÌ¡£ÏÂÃæµÄ²âÊÔÄܹ»ÑéÖ¤ÎÒÃǵļÙÉèÊÇ·ñÕýÈ·£¬ÁíÍâÕâÒ²ÊÇ °²×°Íê³ÉÖ®ºó²âÊÔDNSµÄ»ù±¾²½Öè¡£½ÓÈëÄãµÄISPÈ»ºóÔÚÖն˴°¿ÚÀïÊäÈëÒÔϵÄÃüÁ

nslookup[Enter] Default Server: {ÕâÀïÏÔʾ³öÀ´µÄ¾ÍÊÇISPµÄDNSÃû} Address: {ÏÔʾ³öÀ´µÄ¾ÍÊÇISP·þÎñÆ÷µÄIPµØÖ·}

ÏÖÔÚÊäÈëÒÔÏÂÄÚÈÝ¿´DNSÊÇ·ñ¹¤×÷£º >www.tux.org

ͨ³£ÊÇÕâÑù»ØÓ¦: Name: gwyn.tux.org Address: 207.96.122.8 Aliases: http://www.tux.org/ >exit [Enter]


×¢Òâ - Ò»¶¨ÒªÒþ²ØIPµØÖ·£¬ ³ý·ÇÄãÒѾ­ÉêÇë×¢²áÁËÍøÖ·£¬ÓµÓÐÒ»¸öÕæÕýµÄIPµØÖ·£¬·ñÔòûÓÐÒþ²ØµÄÇ°ÌáÏÂÒª×Ô¼ºÉèÁ¢DNS¾ÍÏëÒ²²»ÓÃÏëÁË¡£ ·´Ö®ÏµÍ³»áÕæµÄ°ÑÄãŪµÄÏ¡ÀïºýÍ¿¸üÉõÖÁ¿ÉÄÜ»áÊÕµ½·¢ÍùÕæÕýÓµÓÐÄǸöIPµØÖ·µÄһЩÂÒÆß°ËÔã µÄemail. ¶øÒþ²ØÁËIPµØÖ·ºó£¬Äã¾Í¿ÉÒÔËæÐÄËùÓûµÄ¸øÄãµÄСÍøÉèÁ¢¸öIPµØÖ·£¬ ͬʱÒþ²ØµÄ»¹ÓÐͨ¹ýInternetÁ¬½ÓµÄÇëÇó

°²×°DNS: ±ØÐë°²×°bind³ÌÐò²ÅÄÜʹDNS¿ªÊ¼¹¤×÷,ÎÒÊÇÈçÏÂÉèÖõģ¬ÓòÃûÉèΪ kulai.org£¬²ÉÓÃÒþ²Ø´ëÊ©ºó£¬Ê¹µÃkulai.orgÔÚÈκεط½¶¼Áв»³ö£¬ ͬʱҲûÓÐÔÚÈκεط½×¢²á¹ý¡£µ±Ñ¡ÔñÁËÄãµÄÓòÃûºó£¬ÎªÁ˱ÜÃ⽫ÊÂÇé¸ãÔ㣬ҪȷÐÅûÓб»ÆäËûÈË×¢²á£¬ ¿ÉÒÔʹÓÃwhois³ÌÐò¼ì²éËùÑ¡µÄÓòÃûÊÇ·ñÒѾ­±»ºÏ·¨Ôò×¢²á£¬Á¬½ÓºÃÒÔºó¿ÉÒÔÏóÏÂÃæÕâÑù½øÐмì²é£º

whois kulai.org [Enter] µÃµ½´óÁ¿µÄ»ØÓ¦ºó£¬ÊÇÒÔÀàËÆÏÂÃæµÄÌáʾÕâÑù½áÊøµÄ£º ÔÚ´ËƪÎÄÕÂÖÐÎÒµÄÏà¹ØµÄÉèÖÃÊÇÕâÑùµÄ

master.kulai.org 192.168.124.10 ½ö°²×°linux , ×öΪ·þÎñÆ÷ jc.kulai.org 192.168.124.1 ͬʱ°²×°ÁËlinux ºÍ win98 fserver.kulai.org 192.168.124.11 ½ö°²×°ÁËfreebsd phillip.kulai.org 192.168.124.20 ½öÓÐwin98

ÉèÖÃDNS: Ê×ÏÈҪʹÓÃÄãÏ°¹ßʹÓõÄÎı¾±à¼­Æ÷´´½¨5¸öÆÕͨµÄÎı¾Îļþ£¬Ò²¿É´ÓÀý³ÌÖп½±´¹ýÀ´£¬Ö»Ðë ½«ÓòÃûºÍIPµØÖ·¸Ä¹ýÀ´£¬Òª×ÐϸµÄÐÞ¸ÄÕâЩÎļþ£¬²»¹ýÒ»¶¨Òª·ûºÏËûÃÇÌØÊâµÄÓï·¨¡£

/etc/named.conf /var/named/db.cache /var/named/db.kulai.org (ÎÒµÄÓòÃûÉèΪÊÇkulai.org) /var/named/db.124.168.192 (µØÖ·ÉèÖÃΪ192.168.124.0) /var/named/db.127.0.0 ¾¯¸æWARNING: ÉèÖÃÍê³ÉDNSºó£¬ÔÚ½«/etc/resolv.conf ¸ÄÃû֮ǰ¾ö²»ÒªÖØÐÂÆô¶¯£¬ ¸ÄÃûºó¼ÆËã»úÖØÆðÀ´ºó£¬ÔٸĻØÀ´£¬Èç¹û´íÎóµÄÉèÖÃDNSºó½«µ¼Ö²»ÄÜÆô¶¯£¬ È»ºóÖ»ÄÜrescueÆô¶¯ÁË£¬¶ø¸ÄÃû¿ÉÒÔ±ÜÃâÕâÑùµÄ´íÎó¡£ Í¬Ê±¼ì²é/etc/nsswitch.cnfµÄÉèÖ㬠¡°hosts¡° Ò»ÐÐÖÐÓ¦¸ÃÈçÏÂÊéд:¡°hosts: files dns¡°. ÕâÑùϵͳ½«Ê×ÏÈͨ¹ý/etc/hosts½øÐÐÓòÃû½âÎö£¬¶ø²»Ö¿ÉÄܱ¨¸æÎÞЧµÄDNS. Èç¹ûÉèÓÐNIS,ÄÇôÕâÐÐÓ¦¸ÃÈçÏÂд£º¡°hosts: files nis dns¡°.



Æô¶¯DNS:½¨³ÉÉÏÊö5¸öÎļþºó£¬±à¼­/etc/resolv.confÎļþ£¬ ÔÚÆäÖнöÁÐÄã×Ô¼ºµÄÖ÷»ú¡£

search kulai.org nameserver 192.168.124.10 Çë×¢ÒâNote: /etc/resolv.conf is manditory for bind 8.* then type: tail -f /var/log/messages[Enter] named ÊØ»¤½ø³ÌÆô¶¯ºó»áÌáʾ´íÎóµÄÐÅÏ¢£¬´ò¿ªÁíÍâµÄ´°¿Ú»òÕßÊÇÔÚÆäËûµÄ¿ØÖÆ̨ÉÏÊäÈ룺 /usr/sbin/ndc start [Enter] (¶ÔÓÚRedHat·¢²¼ÔòÊÇ: /etc/rc.d/init.d/named start ) ÔÚ/var/log/messages ÎļþÖаüº¬ÓйØnamed µÄÌõÄ¿£¬ÒÔÏÂÃæµÄÄÚÈÝ×÷Ϊ½áÊø£º Jul 10 15:54:26 master named: named startup succeeded Jul 10 15:54:26 master named[3523]: Ready to answer queries. Á¬Èëinternetºó£¬ÓÃÉÏÃæ µ±Ç°ÊÇË­ÌṩµÄDNS·þÎñÒ»½ÚÖеķ½·¨À´²âÊÔDNS. ±¨¸æ³öµÄÖ÷»úÃûÓ¦¸ÃÊÇÄã×Ô¼ºµÄDNSÖ÷»ú£¬ ÊäÈëÄã¾­³£ä¯ÀÀµÄµØÖ·¿´ÄÜ·ñÊä³öipµØÖ·¡£ Èç¹û²»ÄÜÕý³£¹¤×÷: 1. Ê×Ïȼì²énamed½ø³ÌÊÇ·ñÔËÐÐ: ps ax|grep named [Enter]

2. ÔÚÆäËûµÄ»úÆ÷ÉÏͨ¹ýIPµØÖ·ºÍ»úÆ÷Ãû³Æpingһϣº ping 192.168.124.10 [Enter] ping master.kulai.org [Enter]

3. telnet Á¬½Óµ½·þÎñÆ÷£¬Èç¹û½ÓÈëµÄʱ¼ä½Ï³¤¾ÍÒâζ×Å¿ÉÄÜÉèÖÃÓÐÎÊÌâ¡£

Èç¹ûÒ»ÇÐÕý³££¬Ö»ÐèÒª½«ÄãСÍøÉϵļÆËã»úÁ¬µ½ÓòÃû·þÎñÆ÷¾Í¿ÉÒÔÁË¡£

Final thoughts½áÊøÓï:ÔÚ´ËÖ»ÊǸø³öÁËÉ趨һ¸ö¼òµ¥µÄdnsµÄ·½°¸£¬¶øͨ³£³É¹¦µÄ¾­Àú¸üÄܼ¤·¢Ñ§Ï°µÄÐËȤ£¬Äã ¿ÉÒÔÔÚÒÔϵÄÍøÖ·ÖÐѧµ½¸ü¶àµÄ¶«Î÷£º

The DNS HOWTO DNS and Bind by O¡®Reilly DNS - ZDNet Webopedia Definition and Links Troubeshooters.com: DNS -- °üº¬ÁËһЩÓëÀÏ°æ±¾bindÓйصÄÄÚÈÝ
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 3 ÌõÆÀÂÛ

  1. MOSSC ÓÚ 2005-10-16 00:43:20·¢±í:

    ѧϰÁË

  2. aini ÓÚ 2005-09-15 11:38:29·¢±í:

    ²»´í£¬Ö§³Ö

  3. Ììʹ ÓÚ 2005-07-29 00:26:16·¢±í:

    ¶¥