h-otterの備忘録

インフラを中心にコンピュータ関連をいいかんじにやっていきます

WinbindでDNSの動的更新

過去の記事で疑問に思っていたことが解決しました。

h-otter.hatenablog.jp

症状

ドメインに参加したときに以下のようなエラーが出力されていた問題です。

$ sudo net ads join -U Administrator 
Enter Administrator's password:
Using short domain name -- DOMAIN
Joined 'client' to dns domain 'domain.local'
No DNS domain configured for client. Unable to perform DNS Update.
DNS update failed: NT_STATUS_INVALID_PARAMETER

ADのDNSが自動更新できない…みたいなエラーだと思います。

解決策

  • /etc/network/interfacesdns-searchを指定
  • /etc/hostsドメインを明示

この2つを行えばうまくいきます。具体的には以下の通りです。

/etc/network/interfaces

auto eth0
iface eth0 inet static
        address 192.168.1.10
        netmask 255.255.255.0
        network 192.168.1.0
        broadcast 192.168.1.255
        gateway 192.168.1.254
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 192.168.1.1
        dns-search domain.local  # <- これ

/etc/hosts

127.0.0.1       localhost
192.168.1.10   client.domain.local     client

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

という感じに更新して、ドメインに参加するだけです。

$ sudo net ads join -U Administrator
Enter Administrator's password:
Using short domain name -- DOMAIN
Joined 'client' to dns domain 'domain.local'