slloyd has asked for the wisdom of the Perl Monks concerning the following question:

Does anyone know how I can use perl to add DNS Suffixes in Windows (Advanced TCP-IP Settings under DNS Tab)? Thanks, Steve

Retitled by davido from 'Adding DNS Suffix in Windows'.

Replies are listed 'Best First'.
Re: OT: Adding DNS Suffix in Windows
by tcf03 (Deacon) on Jan 24, 2005 at 20:04 UTC
    The commandline to do this is:
    regedit -s DNS_suffix.reg

    where DNS_suffix.reg is
    Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters +] "SearchList"="yourdom.com new.yourdom.com test.yourdom.com"
    Depending on how many systems - just use a system call.
Re: OT: Adding DNS Suffix in Windows
by ikegami (Patriarch) on Jan 24, 2005 at 19:47 UTC
    You could use Perl to modify the registry -- HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip seems to be the one of interest -- but the change probably won't occur until you reinitialize the network adapter or the TCP/IP stack, and I don't know how to do that, from Perl or otherwise. A reboot will do the trick.