Batch scripting is a text file containing a series of commands intended to be executed by the command interpreter. Much like a unix / linux shell script, the purpose of a batch script is to sequentially process a series of commands.

Tags | |

Changing DNS settings with a batch script

So, you need to push an updated DNS listing to your users but you can't use a GPO or DHCP. So how can you update DNS with a bat script?




netsh interface ip set dns "Local Area Connection" static 192.168.0.2


That will set the primary DNS value, if you wanted to set secondary values (normally you do), this is how you do it.




netsh interface ip add dns "Local Area Connection" 192.168.0.3


To add more you would repeat the above command




Comments

Feel free to leave a comment or question

Name: (Optional but appreciated):

Comment:

Use [code] [/code] for code block style



Security Code: