Wins nss 主机名解析不起作用

Wins nss 主机名解析不起作用

我正在尝试让胜利名称解析工作。我以为我理解了所需的步骤,但我无法让它发挥作用。

该盒子运行的是 SLES 12 SP1。

这就是我所做的:

  • 添加了一个wins服务器/etc/samba/smb.conf

    [global]
        wins server = 10.3.4.60
    
  • 启用并启动winbind.service

    # systemctl status winbind.service 
    winbind.service - Samba Winbind Daemon
       Loaded: loaded (/usr/lib/systemd/system/winbind.service; enabled)
       Active: active (running) since Tue 2016-05-31 13:25:35 SAST; 1h 27min ago
     Main PID: 32111 (winbindd)
       Status: "winbindd: ready to serve connections..."
       CGroup: /system.slice/winbind.service
               ├─32111 /usr/sbin/winbindd -D
               └─32112 /usr/sbin/winbindd -D
    
    May 31 13:25:35 vt53ipam01 systemd[1]: Starting Samba Winbind Daemon...
    May 31 13:25:35 vt53ipam01 systemd[1]: winbind.service: Supervising process 32111 which is not our child. We'll most likely not notice when it exits.
    May 31 13:25:35 vt53ipam01 winbindd[32111]: [2016/05/31 13:25:35.636807,  0] ../source3/winbindd/winbindd_cache.c:3235(initialize_winbindd_cache)
    May 31 13:25:35 vt53ipam01 winbindd[32111]: initialize_winbindd_cache: clearing cache and re-creating with version number 2
    May 31 13:25:35 vt53ipam01 winbindd[32111]: [2016/05/31 13:25:35.637881,  0] ../lib/util/become_daemon.c:124(daemon_ready)
    May 31 13:25:35 vt53ipam01 winbindd[32111]: STATUS=daemon 'winbindd' finished starting up and ready to serve connections
    May 31 13:25:35 vt53ipam01 systemd[1]: Started Samba Winbind Daemon.
    
  • 将服务添加wins到 nsswitchhosts数据库:

    # grep hosts /etc/nsswitch.conf 
    hosts:      files dns wins
    

如果我调用getent并指定该wins服务,它就会起作用:

# getent -s wins hosts VT53TESTSQL01
10.6.27.20      VT53TESTSQL01

但是getent使用默认服务集调用不起作用:

# getent hosts VT53TESTSQL01
<nothing returned>

我不知道我错过了什么。关于如何让它发挥作用有什么建议吗?

答案1

您尝试过重启吗?

人 nsswitch.conf

在使用 nsswitch.conf 的每个进程中,整个文件仅读取一次。如果稍后更改该文件,该过程将继续使用旧配置。

相关内容