主机名解析顺序

关键字: 主机名解析

折腾机器,明明已经在/etc/hosts里面把一个东西给更新了,但是ping主机名还是ping不通,解析出来的IP地址还是原来的一个地址。后来上网转了一圈,知道解析的顺序是通过配置文件确定的,于是就简单了,在Linux上是/etc/nsswitch.conf,在AIX上是/etc/netsvc.conf,在Linux的配置文件里面写hosts:  files dns,AIX的写hosts = local, bind就可以保证先由/etc/hosts解析了,嗯。

This entry was posted in 小企鹅Linux. Bookmark the permalink.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>