⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 40.html

📁 著名的linux英雄站点的文档打包
💻 HTML
📖 第 1 页 / 共 3 页
字号:
/etc/hosts中包含了IP地址和主机名之间的映射,还包括主机名的别名,IP地址的设计使计算机容易识别,但对于人却很难记住它们,为了解决这个问题,创建了/etc/hosts这个文件。下面是一个例子文件:<br>
<br>
127.0.0.1 machine1 localhost.localdomain localhost<br>
192.168.1.100 machine7<br>
192.168.1.101 otherpc otheralias<br>
<br>
在这个例子中,本机名是machine1,otherpc还有别名otheralias,它可以指向otheralias。。一旦配置完机器的网络配置文件,应该重新启动网络以使修改生效,使用下面的命令来重新启动网络:<br>
<br>
/etc/rc.d/init.d/network restart<br>
<br>
/etc/hosts文件通常含有主机名、localhost和系统管理员经常使用的系统别名,有时候telnet到linux机器要等待很长时间,可以通过在"/etc/hosts"加入客户的机器的IP地址和主机名的匹配项,就可以减少登录等待时间。在没有域名服务器情况下,系统上的所有网络程序都通过查询该文件来解析对应于某个主机名的IP地址,否则,其他的主机名通常使用DNS来解决,DNS客户部分的配置在文件/etc/resolv.conf中。<br>
<br>
◆ /etc/services<br>
<br>
/etc/services中包含了服务名和端口号之间的映射,不少的系统程序要使用这个文件,下面是RedHat 安装时缺省的/etc/services中的前几行:<br>
<br>
tcpmux 1/tcp # TCP port service multiplexer<br>
echo 7/tcp<br>
echo 7/udp<br>
discard 9/tcp sink null<br>
discard 9/udp sink null<br>
systat 11/tcp users<br>
<br>
最左边一列是主机服务名,中间一列是端口号,”/“ 后面是端口类型,可以是TCP也可以是UDP。任何后面的列都是前面服务的别名。在这个文件中也存在着别名,它们出现在端口号后面,在上述例子中sink和null 都是discard服务的别名。<br>
<br>
◆ /etc/host.conf 配置名字解析器<br>
<br>
有两个文件声明系统到哪里寻找名字信息来配置UNIX名字解析器的库。文件/etc/host.conf由版本5的libc库所使用,而/etc/nsswitch.conf由版本6使用(glibc )。问题在于一些程序使用其中一个,而一些使用另一个,所以将两个文件都配置正确是必要的。<br>
<br>
/etc/host.conf文件指定如何解析主机名,linux通过解析器库来获得主机名对应的IP地址。下面是RedHat安装后缺省的"/etc/host.conf"内容:<br>
<br>
order hosts,bind<br>
multi on<br>
<br>
※"order " 指定主机名查询顺序,其参数为用逗号隔开的查找方法,支持的查找方法为bind、hosts和nis,分别代表DNS、/etc/hosts和NIS,这里规定先查询"/etc/hosts"文件然后再使用DNS来解析域名。<br>
※"trim" 表明当通过DNS进行地址到主机名的转换时,域名将从主机名中被裁剪掉,trim可以被多个域包含多次,对/etc/hosts和NIS查询方法不起作用,注意在/etc/hosts和NIS表中主机名是被适当地(有或没有全域名)列出的。<br>
※"multi" 指定是否"/etc/hosts"文件中指定的主机可以有多个地址,值为on表示允许,拥有多个IP地址的主机一般称为具有多个网络界面。<br>
※"nospoof " 指是否允许对该服务器进行IP地址欺骗,值为on表示不允许,IP欺骗是一种攻击系统安全的手段,通过把IP地址伪装成别的计算机,来取得其它计算机的信任。<br>
※"alert" 当nospoof指令为on时,alert控制欺骗的企图是否用syslog工具进行记录,值为on表示使用,缺省值为off。<br>
※"rccorder" 如果被设置为on,所有的查询将被重新排序,所以在同一子网中的主机将首选被返回,缺省值为off。<br>
<br>
◆ /etc/nsswitch.conf 配置名字解析器<br>
<br>
/etc/nsswitch.conf文件是由S u n公司开发并用于管理系统中多个配置文件查找的顺序,它比/etc/host.conf文件提供了更多的功能。/etc/nsswitch.conf中的每一行或者是注释(以#号开头)或者是一个关键字后跟冒号和一系列要试用的有顺序的方法。每一个关键字是在/etc/目录可以被/etc/nsswitch.conf控制的/etc文件的名字。下面是可以被包含的关键字:<br>
<br>
※aliases 邮件别名;<br>
※passwd 系统用户;<br>
※group 用户组;<br>
※shadow 隐蔽口令;<br>
※hosts 主机名和I P地址;<br>
※networks 网络名和号;<br>
※protocols 网络协议;<br>
※services 端口号和服务名称;<br>
※ethers 以太网号;<br>
※rpc 远程进程调用的名称和号<br>
※netgroup 网内组<br>
<br>
下面也是可以包含的关键字:<br>
<br>
※files 除了netgroup,对其他关键字都有效。在相应的/etc文件中寻找记录<br>
※db 除了netgroup,对其他关键字都有效。在相应的/var/db数据库中寻找记录。对长文件很有效,如passwd文件已经 超过500项。要从标准/etc文件中产生这些文件,应改变目录到/var/db并运行run命令<br>
※compat 兼容性模式,对passwd、group和shadow文件有效。在本模式中,将先在对应的/etc文件中查找。如果想进行NIS查找,需要第一个值(用户名或组名)为加号( + ),后面跟对应数量的冒号( : ) ( /etc/passwd为6个, /etc/group为3个, /etc/shadow为8个)。如在/etc/passwd文件中,下面一行应被包含在文件尾: + : * : : : : :<br>
※dns 只对hosts有意义。像在/etc/resolvconf配置的,在DNS中进行查找<br>
※nis 对所有的关键字都有意义。如NIS是可以用的,在NIS服务器中查找<br>
※[ STATUS = action ] 控制名字服务的行为。STATUS是SUCCESS(操作被成功执行)、NOTFOUND (记录没找到)、UNAVAIL (所选择的服务不可用)和TRYAGAIN (服务暂时不可用,请重试)中的一个。action是return (终止查找并返回当前状态)或continue (继续这一行的其他项)中的一个。如hosts: dns nis [NOTFOUND=return] files将会首先在DNS中,然后在NIS中查找主机名。只有当前两项都不可用时才使用文件/etc/hosts<br>
<br>
◆ /etc/resolv.conf 配置DNS客户<br>
<br>
文件/etc/resolv.conf配置DNS客户,它包含了主机的域名搜索顺序和DNS服务器的地址,每一行应包含一个关键字和一个或多个的由空格隔开的参数。下面是一个例子文件:<br>
<br>
search mydom.edu.cn<br>
nameserver 210.34.0.14<br>
nameserver 210.34.0.2<br>
<br>
合法的参数及其意义如下:<br>
※nameserver 表明DNS服务器的IP地址。可以有很多行的nameserver,每一个带一个I P地址。在查询时就按nameserver在本文件中的顺序进行,且只有当第一个nameserver没有反应时才查询下面的nameserver.<br>
※domain 声明主机的域名。很多程序用到它,如邮件系统;当为没有域名的主机进行DNS查询时,也要用到。如果没有域名,主机名将被使用,删除所有在第一个点( . )前面的内容。<br>
※search 它的多个参数指明域名查询顺序。当要查询没有域名的主机,主机将在由search声明的域中分别查找。domain和search不能共存;如果同时存在,后面出现的将会被使用。<br>
※sortlist 允许将得到域名结果进行特定的排序。它的参数为网络/掩码对,允许任意的排列顺序。Red Hat中没有提供缺省的/ e t c / r e s o l v. c o n f文件,它的内容是根据在安装时给出的选项动态创建的。<br>
<br>
◆ /etc/init.d/network 主机地址、子网掩码和网关<br>
<br>
不像很多其他的UNIX和linux操作系统, Red Hat当前并不能自动地通过/etc/hostname和/etc/hosts文件来配置网络。为了改变主机缺省的IP地址,必须直接编辑/etc/init.d/network脚本使其反映正确的网络配置。这个文件包括了声明IP地址、掩码、网络、广播地址和缺省路由器的变量。下面是这个文件中相应的部分:<br>
<br>
IPADDR=192.168.1.100<br>
NETMASK=255.255.255.0<br>
BROADCAST=192.168.1.255<br>
GATEWAY=192.168.1.1<br>
</FONT><br>
                                      </TD>
                                    </TR>
                                <TR>
                                <TD colSpan=2><FONT 
                                class=middlefont></FONT><BR>
                                        <FONT 
                                class=normalfont>全文结束</FONT> </TD>
                                    </TR>
                                <TR>
                                <TD background="images/dot.gif" tppabs="http://www.linuxhero.com/docs/images/dot.gif" colSpan=2 
                                height=10></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></DIV></TD>
                        <TD vAlign=top width="20%" 
                      background="images/line.gif" tppabs="http://www.linuxhero.com/docs/images/line.gif" rowSpan=2> 
                          <DIV align=center> 
                            <table class=tableoutline cellspacing=1 cellpadding=4 
                        width="100%" align=center border=0>
                              <tr class=firstalt> 
                                <td noWrap background="images/bgline.gif" tppabs="http://www.linuxhero.com/docs/images/bgline.gif" colspan=2 height=21>
                                <font class=normalfont><b>所有分类</b></font></td>
                              </tr>
<tr class=secondalt> <td noWrap width=27%> <font class=normalfont>1:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type1.html" tppabs="http://www.linuxhero.com/docs/type1.html">非技术类</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>2:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type2.html" tppabs="http://www.linuxhero.com/docs/type2.html">基础知识</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>3:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type3.html" tppabs="http://www.linuxhero.com/docs/type3.html">指令大全</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>4:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type4.html" tppabs="http://www.linuxhero.com/docs/type4.html">shell</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>5:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type5.html" tppabs="http://www.linuxhero.com/docs/type5.html">安装启动</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>6:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type6.html" tppabs="http://www.linuxhero.com/docs/type6.html">xwindow</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>7:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type7.html" tppabs="http://www.linuxhero.com/docs/type7.html">kde</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>8:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type8.html" tppabs="http://www.linuxhero.com/docs/type8.html">gnome</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>9:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type9.html" tppabs="http://www.linuxhero.com/docs/type9.html">输入法类</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>10:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type10.html" tppabs="http://www.linuxhero.com/docs/type10.html">美化汉化</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>11:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type11.html" tppabs="http://www.linuxhero.com/docs/type11.html">网络配置</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>12:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type12.html" tppabs="http://www.linuxhero.com/docs/type12.html">存储备份</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>13:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type13.html" tppabs="http://www.linuxhero.com/docs/type13.html">杂项工具</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>14:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type14.html" tppabs="http://www.linuxhero.com/docs/type14.html">编程技术</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>15:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type15.html" tppabs="http://www.linuxhero.com/docs/type15.html">网络安全</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>16:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type16.html" tppabs="http://www.linuxhero.com/docs/type16.html">内核技术</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>17:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type17.html" tppabs="http://www.linuxhero.com/docs/type17.html">速度优化</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>18:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type18.html" tppabs="http://www.linuxhero.com/docs/type18.html">apache</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>19:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type19.html" tppabs="http://www.linuxhero.com/docs/type19.html">email</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>20:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type20.html" tppabs="http://www.linuxhero.com/docs/type20.html">ftp服务</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>21:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type21.html" tppabs="http://www.linuxhero.com/docs/type21.html">cvs服务</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>22:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type22.html" tppabs="http://www.linuxhero.com/docs/type22.html">代理服务</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>23:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type23.html" tppabs="http://www.linuxhero.com/docs/type23.html">samba</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>24:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type24.html" tppabs="http://www.linuxhero.com/docs/type24.html">域名服务</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>25:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type25.html" tppabs="http://www.linuxhero.com/docs/type25.html">网络过滤</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>26:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type26.html" tppabs="http://www.linuxhero.com/docs/type26.html">其他服务</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>27:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type27.html" tppabs="http://www.linuxhero.com/docs/type27.html">nfs</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>28:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type28.html" tppabs="http://www.linuxhero.com/docs/type28.html">oracle</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>29:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type29.html" tppabs="http://www.linuxhero.com/docs/type29.html">dhcp</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>30:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type30.html" tppabs="http://www.linuxhero.com/docs/type30.html">mysql</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>31:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type31.html" tppabs="http://www.linuxhero.com/docs/type31.html">php</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>32:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type32.html" tppabs="http://www.linuxhero.com/docs/type32.html">ldap</a></font></td>    </tr>  </table></td></tr>                            </table>
                          </DIV></TD></TR>
                    <TR vAlign=top>
                        <TD width="80%"> 
                          <DIV align=center><BR>
                          </DIV>
                        </TD></TR></TBODY></TABLE></TD></TR>
                </TABLE></TD></TR>
          </TABLE>
      <TABLE cellSpacing=0 cellPadding=4 width="100%" bgColor=#eeeeee 
        border=0><TBODY>
        <TR>
          <TD width="50%">
              <P><FONT class=middlefont>版权所有 &copy; 2004 <A 
            href="mailto:bjchenxu@sina.com">linux知识宝库</A><BR>
                违者必究. </FONT></P>
            </TD>
          <TD width="50%">
              <DIV align=right><FONT class=middlefont>Powered by: <A 
            href="mailto:bjchenxu@sina.com">Linux知识宝库</A> Version 0.9.0 </FONT></DIV>
            </TD></TR></TBODY></TABLE>
      <CENTER></CENTER></TD></TR>
    </TABLE></CENTER></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -