How To Add, Delete, Change and Flush Windows Routing Table in Windows 7, Vista and XP via Command Line

From time to time some of the computers in the network start acting funny and do not resolve particular network or web address. Most of the time, when we look at it, the main culprit is the DNS but some times its the routing on that particular PC that needs to be fixed. Today, I will show you how to add or remove routes in Windows Routing Table via CMD. You can also put persistent route in the routing table or flush the entire routing table via command line. So lets start.

First and foremost, check what routes you already have in your PC by typing in following command. This displays route details:

route print

Now if you want to add route to the table, you just type in following command

route add [destination host] mask [subnet mask value] [gateaway] metric [metric] if [interface number]

See Example Below:


To remove route from the Windows Routing Table, just type in:

route delete

See Example Below:


To add route and make route persistent, just add -p in command when you are adding the route:

route -p add

See Example Below:


To flush the entire Windows Routing Table, just use /f switch with route command. If you put another command along with flush command, Windows will first flush the routing table and then execute the commmand.

route /f

See Example Below:


Additionally, you can check your TCP/IP connections, routing and protocol statistics using NETSTAT command. We will leave it for another tutorial with in-depth usage and compilation of NETSTAT commands. You can also find more ways to resolve DNS issues with the tips listed in the linked article.


Hope you find this article useful and resourceful. If you have any questions or suggestions, do leave us a comment below. Thanks.



4 comments on “How To Add, Delete, Change and Flush Windows Routing Table in Windows 7, Vista and XP via Command Line

  1. Valuable information. Lucky me I discovered your web site by
    accident, and I’m surprised why this accident didn’t
    happened in advance! I bookmarked it.

  2. My brother recommended I may like this web site.
    He used to be totally right. This publish truly made my day.
    You can not consider just how so much time I had spent
    for this info! Thanks!

Leave a Reply

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

× 7 = seven

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>