Results 1 to 5 of 5

Thread: Command prompt to change dns

  1. #1
    Join Date
    May 2008
    Posts
    95

    Command prompt to change dns

    Hello friends,

    I would like to alter my DNS address using the command prompt line.I like to change my ip simply by clicking a .bat file. I know the commands to change my ip but the command to change my dns address is some way absent. I know there are some other ways to do it,but I am stubborn with this way.Can any one guide me in this concern..

    Any ideas should be brilliant and highly appreciable.!!
    Cheers..!!

  2. #2
    Join Date
    May 2008
    Posts
    2,137

    Re: Command prompt to change dns

    Netsh is a utility to alter system networking settings, locally or remotely.When the command prompt comes up type Netsh, To change the Local Area Connection TCP/IP settings type the following command:

    interface ip set address name=”Local Area Connection” static 192.168.10.42 255.255.255.0 192.168.1.1

    Netsh IP address change
    Altering the DNS IP address is almost identical as the procedure above, type the following command on the Netsh prompt.interface ip set dns “Local Area Connection” static 192.168.1.1To Setup WINS, type the following command:

    interface ip set wins “Local Area Connection” static 192.168.1.1

    To configure the network properties to obtain the IP address from a DHCP server, type the following command:

    interface ip set address “Local Area Connection” dhcp

    To set DNS to obtain IP address automatically type the following:

    netsh interface ip set dns “Local Area Connection” dhcp

  3. #3
    Join Date
    Oct 2005
    Posts
    2,358

    Re: Command prompt to change dns

    Dude, If you're Aiming at the locations of the DNS servers your computer is using they are given by your ISP when you get an IP address. If you know the address of alternate DNS servers you can "hardcode" them into your settings.If you wan to the reverse DNS name you show up as when on the internet, that again is assigned by your ISP.

  4. #4
    Join Date
    Apr 2008
    Posts
    2,578

    Re: Command prompt to change dns

    Command to alter IP

    netsh int ip set address “local area connection” static 192.168.0.101 255.255.255.0 192.168.0.254 1.

    Command to alter DNS

    netsh int ip set dns “local area connection” static 192.168.0.254 primary

    You have to alter these values according to your own network.Both commands are designed by assuming that you want to change your IP to 192.168.0.101, your default gateway is 192.168.1.254, your DNS is 192.168.0.254 and the name of the network adapter is local area connection.

  5. #5
    certifications4you Guest

    Re: Command prompt to change dns

    nice topic........................

    Quote Originally Posted by johnson22 View Post
    Netsh is a utility to alter system networking settings, locally or remotely.When the command prompt comes up type Netsh, To change the Local Area Connection TCP/IP settings type the following command:

    interface ip set address name=”Local Area Connection” static 192.168.10.42 255.255.255.0 192.168.1.1

    Netsh IP address change
    Altering the DNS IP address is almost identical as the procedure above, type the following command on the Netsh prompt.interface ip set dns “Local Area Connection” static 192.168.1.1To Setup WINS, type the following command:

    interface ip set wins “Local Area Connection” static 192.168.1.1

    To configure the network properties to obtain the IP address from a DHCP server, type the following command:

    interface ip set address “Local Area Connection” dhcp

    To set DNS to obtain IP address automatically type the following:

    netsh interface ip set dns “Local Area Connection” dhcp

Similar Threads

  1. Change the colors in the command prompt
    By Venator in forum Customize Desktop
    Replies: 1
    Last Post: 08-06-2011, 06:33 AM
  2. How to change Command Prompt settings
    By rIh@n in forum Operating Systems
    Replies: 3
    Last Post: 17-08-2009, 03:04 PM
  3. Can’t change drive in command prompt
    By Zayd in forum Operating Systems
    Replies: 3
    Last Post: 14-08-2009, 03:26 PM
  4. about the command prompt
    By Gorganzola in forum Windows Software
    Replies: 2
    Last Post: 17-10-2008, 06:24 PM
  5. Command prompt "COPY" command not working in brand new Windows Vis
    By CMD COPY command not working in Vista in forum Vista Help
    Replies: 7
    Last Post: 06-02-2008, 01:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •