我们的客户使用我们的DHCP服务器ourcompany.com发出的域作为它们的默认search后缀。 我想为他们添加第二个域名进行search。 /etc/resolv.conf看起来像是在其他进程启动时被覆盖。 我假设我将需要运行一个默认写com.apple.blahblahblah命令或脚本。
有没有人做过这个?
谢谢,汤姆
如果ARD客户端安装在工作站上,则可以使用“networksetup”命令来设置此属性。 在10.5和更高,我相信客户端自动安装和10.2-10.4你可能需要安装它,以获得完整的function。
networksetup也有两个path,取决于客户端是否带有操作系统或必须安装:/ usr / sbin / networksetup /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/networksetup
您需要的标志是“-setsearchdomains”,带有两个参数 – 要设置的networking设备,后面是search域。
所以,一个基本上适合你的脚本应该是:
#!/bin/sh /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/networksetup -setsearchdomains AirPort ourcompany.com example.com /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/networksetup -setsearchdomains "Built-in Ethernet" ourcompany.com example.com /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/networksetup -setsearchdomains Ethernet ourcompany.com example.com /usr/sbin/networksetupnetworksetup -setsearchdomains AirPort ourcompany.com example.com /usr/sbin/networksetupnetworksetup -setsearchdomains "Built-in Ethernet" ourcompany.com example.com /usr/sbin/networksetupnetworksetup -setsearchdomains Ethernet ourcompany.com example.com exit 0
您可以通过ARD一个接一个地推送这些命令,或者通过packagemaker或iceberg创build一个无有效载荷包,通过ARD(我会做后者)把它作为一个包打包出去。 该脚本应该改变任何OS X机器上的所有networking设备以拥有您的首选searchpath,但只会为当前的networkingconfiguration文件设置。 要更改其他networkingconfiguration文件,您必须先创build另一个configuration文件。
这有帮助吗?
你有没有尝试在DHCP服务器上设置两个域名? ISC DHCPd支持:
option domain-search domain-list; The domain-search option specifies a 'search list' of Domain Names to be used by the client to locate not-fully-qualified domain names. The difference between this option and historic use of the domain- name option for the same ends is that this option is encoded in RFC1035 compressed labels on the wire. For example: option domain-search "example.com", "sales.example.com", "eng.example.com";