LinuxÉèÖÃDNSºÍÖ÷»úÃû
LinuxÏÂÅäÖþ²Ì¬IPµØÖ·£¬ÉèÖÃDNSºÍÖ÷»úÃû
ÅäÖÃÎļþλÓÚ£º
/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.0.3
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
ʹIPµØÖ·ÉúЧ£º
/sbin/ifdown eth0
/sbin/ifup eth0
ÅäÖÃdns½âÎö
echo "nameserver 211.98.1.28">> /etc/resolv.conf
֪ͨÍø¹Ø¸üÐÂÐÅÏ¢£º
/etc/init.d/network restart
¡¡¢Ù¼ò½é
¡¡¡¡DNS¾ÍÊÇDomain Name System£¬ËüÄܹ»°ÑÐÎÈçwww.21php.comÕâÑùµÄÓòÃûת»»Îª211.152.50.35ÕâÑùµÄIPµØÖ·£»Ã»ÓÐDNS£¬ä¯ÀÀ21php.com Õâ¸öÍøվʱ£¬¾Í±ØÐëÓÃ211.152.50.35ÕâôÄѼǵÄÊý×ÖÀ´·ÃÎÊ¡£ÌṩDNS·þÎñµÄ¾ÍÊÇDNS·þÎñÆ÷¡£DNS·þÎñÆ÷¿ÉÒÔ·ÖΪÈýÖÖ£¬¸ßËÙ»º´æ·þÎñÆ÷ (Cache-only server)¡¢Ö÷·þÎñÆ÷(Primary Name server)¡¢¸¨Öú·þÎñÆ÷(Second Name Server)¡£
¡¡¡¡DNSµÄÏêϸÔÀí¡¢¹¤×÷Á÷³Ì¡¢ÊõÓï¡¢¸ÅÄÏÞÓÚƪ·ù£¬ÕâÀï¾Í²»ËµÁË¡£¿ÉÒÔÔĶÁרÃŵÄÎÄÕ£¬ÈçDNS-HOWTO¼ÓÒÔÁ˽⡣
¡¡¡¡¢ÚÅäÖÃÖ÷DNS·þÎñÆ÷
¡¡¡¡Ê×ÏÈÎÒÃÇ×öÒÔϼÙÉ裺A·þÎñÆ÷Ϊ21php.comµÄÖ÷ÓòÃû·þÎñÆ÷£¬ÆäIPµØַΪ11.0.0.1£¬B·þÎñÆ÷Ϊ21php.comµÄ¸¨ÖúÓòÃû·þÎñÆ÷£¬ÆäIPµØַΪ11.0.0.2£»
¡¡¡¡ÏÂÃæÎÒÃÇÅäÖ÷þÎñÆ÷11.0.0.1Ϊ21PHP.COMµÄÖ÷DNS·þÎñÆ÷
¡¡¡¡LinuxϵÄdns¹¦ÄÜÊÇͨ¹ýbindÈí¼þʵÏֵġ£bindÈí¼þ°²×°ºó£¬»á²úÉú¼¸¸ö¹ÌÓÐÎļþ£¬·ÖΪÁ½À࣬һÀàÊÇÅäÖÃÎļþÔÚ/etcĿ¼Ï£¬Ò»ÀàÊÇdns¼Ç¼ÎļþÔÚ/var/namedĿ¼Ï¡£¼ÓÉÏÆäËûÏà¹ØÎļþ£¬¹²Í¬ÉèÖÃdns·þÎñÆ÷¡£ÏÂÃæÊÇËùÓкÍdnsÉèÖÃÏà¹ØÎļþµÄÁбíÓë˵Ã÷¡£
¡¡¡¡Î»ÓÚ/etcĿ¼ÏµÄÓУºhosts,host.conf,resolv.conf,named.boot,named.conf¡£
¡¡¡¡1¡¢“hosts”Îļþ£¬¶¨ÒåÁËÖ÷»úÃûºÍipµØÖ·µÄ¶ÔÓ¦£¬ÆäÖÐÒ²Óн«ÒªÔËÐÐdnsÕą̂µçÄÔµÄipµØÖ·ºÍÖ÷»úÃû¡£ÄÚÈÝ£º
¡¡¡¡127.0.0.1 localhost.localdomain localhost
¡¡¡¡2¡¢“host.conf”Îļþ[Boban×¢£ºÔÀ´Îóд³Éhosts.conf]£¬"order hosts bind"Óï¾ä£¬Ö¸¶¨Á˶ÔÖ÷»úÃûµÄ½âÎö˳ÐòÊÇÏȵ½hostsÖвéÕÒ£¬È»ºóµ½dns·þÎñÆ÷µÄ¼Ç¼Àï²éÕÒ¡£“multi on”ÔòÊÇÔÊÐíÒ»¸öÖ÷»úÃû¶ÔÓ¦¶à¸öipµØÖ·¡£ÄÚÈÝ£º
¡¡¡¡order hosts, bind
¡¡¡¡multi on
¡¡¡¡nospoof on
¡¡¡¡3¡¢“resolv.conf”Îļþ£¬“nameserver 10.0.0.211”Ö¸¶¨ÁËdns·þÎñÆ÷µÄµØÖ·¡£×¢Ò⣬Õâ¸öÎļþ¶ÔÆÕͨ·Çdns·þÎñÆ÷µÄµçÄÔ(·ÇwindowsµÄϵͳ£»WindowsϵͳÊÇÔÚ“ÍøÂçÊôÐÔ”ÖÐÉèÖÃÕâÏîµÄ)À´Ëµ£¬ÊDZز
Ïà¹ØÎĵµ£º
Ìõ¼þ±äÁ¿Í¨¹ýÔÊÐíÏß³Ì×èÈûºÍµÈ´ýÁíÒ»¸öÏ̷߳¢ËÍÐźŵķ½·¨ÃÖ²¹ÁË»¥³âËøµÄ²»×㣬Ëü³£ºÍ»¥³âËøÒ»ÆðʹÓá£Ê¹ÓÃʱ£¬Ìõ¼þ±äÁ¿±»ÓÃÀ´×èÈûÒ»¸öỊ̈߳¬µ±Ìõ¼þ²»Âú×ãʱ£¬Ïß³ÌÍùÍù½â¿ªÏàÓ¦µÄ»¥³âËø²¢µÈ´ýÌõ¼þ·¢Éú±ä»¯¡£Ò»µ©ÆäËüµÄij¸öÏ̸߳ıäÁËÌõ¼þ±äÁ¿£¬Ëü½«Í¨ÖªÏàÓ¦µÄÌõ¼þ±äÁ¿»½ÐÑÒ»¸ö»ò¶à¸öÕý±»´ËÌõ¼þ±äÁ¿×èÈûµ ......
תÔØʱÇë×¢Ã÷³ö´¦ºÍ×÷ÕßÁªÏµ·½Ê½
ÎÄÕ³ö´¦£ºhttp://www.limodev.cn/blog
×÷ÕßÁªÏµ·½Ê½£ºÀîÏȾ² <xianjimli at hotmail dot com>
Ëæ×ÅXPµÄÁ÷ÐУ¬ÈËÃÇÔ½À´Ô½×¢ÖØÈí¼þµÄÇ°ÆÚÉè¼Æ¡¢ºóÆÚµÄʵÏÖ£¬ÒÔ¼°¹á´©ÓÚÆäÖеIJâÊÔ¹¤×÷£¬¾¹ýÕâ¸ö¹ý³Ì³öÀ´µÄ×ÔÈ»ÊǸßÖÊÁ¿µÄÈí¼þ¡£ÉõÖÁÓÐÈËÉù³ÆXP»áÌÔ̵÷ÊÔÆ÷£¡Õ⵱ȻÊÇÓÐÒ»¶¨µÀÀíµÄ£¬È ......
/*
* ¸ÃÎļþʵÏÖϵͳµ÷ÓÃread£¬writeºÍlseek¡£
*/
/*
* linux/fs/read_write.c
*
* (C) 1991 Linus Torvalds
*/
#include <sys/stat.h>
#include <errno.h>
#include <sys/types.h>
#include <linux/kernel.h>
#include < ......
/*
* linux/fs/char_dev.c
*
* (C) 1991 Linus Torvalds
*/
#include <errno.h>
#include <sys/types.h> // ¶¨ÒåÁË»ù±¾µÄϵͳÊý¾ÝÀàÐÍ
#include <linux/sched.h>
#include <linux/kernel.h> // º¬ÓÐһЩÄں˳£Óú¯ÊýµÄÔÐζ¨Òå
#include < ......
תÔØ£ºhttp://www.cnblogs.com/hexapodsoft/archive/2007/04/24/724902.html
I/OÖض¨ÏòÏê½â¼°Ó¦ÓÃʵÀý
1¡¢ »ù±¾¸ÅÄÕâÊÇÀí½âºóÃæµÄ֪ʶµÄÇ°ÌᣬÇëÎñ±ØÀí½â£©
a¡¢ I/OÖض¨Ïòͨ³£Óë FDÓйأ¬shellµÄFDͨ³£Îª10¸ö£¬¼´ 0¡«9£»
b¡¢ ³£ÓÃFDÓÐ3¸ö£¬Îª0£¨stdin£¬±ê×¼ÊäÈ룩¡¢1£¨stdout£¬±ê×¼Êä³ö£©¡¢2£¨stderr£¬±ê×¼´íÎóÊä ......