IPconfig Release and Renew Batch File

Novice: dl dl dl

Having difficulty getting connected to the internet? The very first thing I do is release and renew my network adapter using ipconfig. During that process I normally renew and re-register my DNS as well. This is a fairly simple process that can be done with command prompt, but we can automate the process even further by creating a batch file to execute the commands for us. Take a look.

Step 1:  Open notepad++ or your favorite text editor, then type the following:

ipconfig /release
ipconfig /flushdns
ipconfig /renew
ipconfig /registerdns

Note: Make sure each command is on a new line by itself

Step 2: File > Save As > ‘refresh_network.bat’ – Whatever name you choose isn’t vastly important…The key is to save the file with the .bat extension so that the text editor outputs your text as a batch file

rrrcmd rnbatch

You’re Done – You should end up with a batch file like the one to the left

So now you may be wondering…WTF does this do?  Well, lets take a look at what each command does:

/release: Sends a DHCPRELEASE message to the DHCP server to release the current DHCP configuration and discard the IP address configuration for either all adapters (if an adapter is not specified) or for a specific adapter if the Adapter parameter is included. This parameter disables TCP/IP for adapters configured to obtain an IP address automatically. To specify an adapter name, type the adapter name that appears when you use ipconfig without parameters.

/flushdns: Flushes and resets the contents of the DNS client resolver cache. During DNS troubleshooting, you can use this procedure to discard negative cache entries from the cache, as well as any other entries that have been added dynamically.

/renew: Renews DHCP configuration for all adapters (if an adapter is not specified) or for a specific adapter if the Adapter parameter is included. This parameter is available only on computers with adapters that are configured to obtain an IP address automatically. To specify an adapter name, type the adapter name that appears when you use ipconfig without parameters.

/registerdns: Initiates manual dynamic registration for the DNS names and IP addresses that are configured at a computer. You can use this parameter to troubleshoot a failed DNS name registration or resolve a dynamic update problem between a client and the DNS server without rebooting the client computer. The DNS settings in the advanced properties of the TCP/IP protocol determine which names are registered in DNS.


Leave a Reply

Your email address will not be published. Required fields are marked *

*