Kaseya Community

DNS Servers

  • Does anyone know a way to script the changing of DNS servers on both W2K Pro and XP Pro machines in a non AD non DHCP environment? I noticed that if I change the DNS server in the local group policy it does not show up when I perform an ipconfig /all but if I perform a NSLOOKUP it uses the changed DNS server. I would like to find a way to change the DNS servers via a script that will be reflected in the IPCONFIG results.

    Legacy Forum Name: DNS Servers,
    Legacy Posted By Username: akoop
  • Here's a script I used to change DNS servers:

    The first command SETs the primary, the second command ADDs the secondary.

    Script Name: Set DNS Servers - Trinity
    Script Description:

    IF True
    THEN
    Execute Shell Command
    Parameter 1 : netsh interface ip set dns "Local Area Connection" static 10.1.1.2
    Parameter 2 : 1
    OS Type : 0
    Execute Shell Command
    Parameter 1 : netsh interface ip add dns "Local Area Connection" 10.2.1.2
    Parameter 2 : 1
    OS Type : 0
    ELSE



    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: jamie177
  • Is there anyway to "WildCard" the connection name?

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: akoop
  • Not as far as I'm aware as the netsh command usually applies to a specific interface.

    You could possibly use a script to get the name of the interface and write it to a variable, but I'm not sure how you'd go about this.

    Cheers.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: LANWorx