[通告] 本论坛迁移啦~请前往位于 https://forum.archlinuxcn.org/ 的新论坛。所有帖子和参与的用户都已经迁移。
您正在访问的是原 bbs.archlinuxcn.org 的静态存档。本页面的新地址位于 https://forum.archlinuxcn.org/t/topic/6439。
页次: 1
看了一遍http://0pointer.de/lennart/projects/nss-myhostname/#documentation,还是有部分内容没能很好的理解:
It is recommended to put myhostname last in the nsswitch.conf line to make sure that this mapping is only used as fallback
上面这句话是什么意思,nsswithch.conf line是什么意思?
另外,127.0.0.1和127.0.0.2有什么区别?
nss-myhostname官方文档:
http://0pointer.de/lennart/projects/nss … umentation
离线
# /etc/nsswitch.conf
passwd: compat
group: compat
shadow: compat
hosts: files dns myhostname
networks: files
protocols: db files
services: db files
ethers: db files
rpc: db files
netgroup: nis
就是像黑体标出的一样,把myhostname写在那一行的最后一个,保证files、dns比它优先。
离线
离线
页次: 1