带有 DHCP 服务器的 Samba4 内部 DNS

带有 DHCP 服务器的 Samba4 内部 DNS

在 FreeBSD 上,我们运行 Samba4 作为 DC,直到最近,我们的 IP 地址都是由路由器 DHCP 服务器分配的。我们切换到在 FreeBSD 机器上运行 DHCP 服务器,配置如下:

# dhcpd.conf
#
# Sample configuration file for ISC dhcpd 
#

# option definitions common to all supported networks...
option domain-name "hlb.net";
option domain-name-servers 192.168.1.4;

default-lease-time 600;
max-lease-time 7200;

# Use this to enble / disable dynamic dns updates globally.
#ddns-update-style none;

# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
authoritative;

# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7;


# This is a very basic subnet declaration.

subnet 192.168.1.0 netmask 255.255.255.0 {
  range 192.168.1.5 192.168.1.253;
  option routers 192.168.1.254;
} 

我们现在无法将机器添加到域中。输入凭据后,Windows 8.1 客户端会抱怨“找不到路径”,无论凭据是否正确。

Samba4 配置非常简单:-

#Global parameters
[global]
    workgroup = HLB
    realm = HLB.NET
    netbios name = SERVER1
    server role = active directory domain controller
    dns forwarder = 192.168.1.254
    nsupdate command = /usr/local/bin/samba-nsupdate -g
    allow dns updates = nonsecure

[netlogon]
    path = /var/db/samba4/sysvol/hlb.net/scripts
    read only = No

[sysvol]
    path = /var/db/samba4/sysvol
    read only = No

[home]
    path = /srvdata/homes
    read only = No

[profiles]
    path = /srvdata/profiles
    read only = No

[packages]
    path = /srvdata/packages
    read only = No

DNS 测试似乎符合预期:- host -t SRV _ldap._tcp.hlb.net 收益:-

_ldap._tcp.hlb.net has SRV record 0 100 389 server1.hlb.net.

和:-

host -t SRV _kerberos._udp.hlb.net

产量:-

_kerberos._udp.hlb.net has SRV record 0 100 88 server1.hlb.net.

最后,通过以下方式测试 DNS A 记录:

host -t A SERVER1.hlb.net

返回以下内容:-

SERVER1.hlb.net has address 192.168.1.4

看来我们在设置 DHCP 服务器时可能遗漏了一些配置选项,但目前我们束手无策。任何见解都将非常有用,因为我们确信其他人也有与我们类似的设置。

答案1

尝试将您的 DNS 服务器定义到您的子网中:

subnet 192.168.1.0 netmask 255.255.255.0 {
  range 192.168.1.5 192.168.1.253;
  option routers 192.168.1.254;
  option domain-name "hlb.net";
  option domain-name-servers 192.168.1.4;
} 

相关内容