Windows – Static route for entire octet or by host name

networkingroutestatic-routeswindowswindows 7

I've added a few static routes, for the most part the following has worked fine:

route add 123.123.123.123 mask 255.255.255.255 100.100.100.100 metric 10 -p

However, one URL resolves to more that one IP address / it isn't static. Is there any way to change the command above to include an entire octet, i.e. 123.123.123.*

If not, can I make a static route based on the host name? So anything matching example.com would use the route?

I know, from a networking / purist perspective that routing tables don't really relate to host names / DNS – but M$'s documentation seems to indicate that 'feature' is present (rightly or wrongly):

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/sag_tcpip_pro_addstaticroute.mspx?mfr=true

Best Answer

You can "wildcard" IP addresses by just changing the netmask:

route add 192.0.2.0 mask 255.255.255.0 <router>

There's no way to route to a hostname, because names are handled at a higher level of the network stack.