abc.local
xyz.local
dumy.local
www.google.com
local.testserver.net

....

Can we write some kind of regular expression or Rule in "hosts" file to redirect certain domains ending .local to certain ip address. like using above domains.

192.168.0.10 *.local
192.168.0.1 www.*
192.168.0.100 local.*.*

// Hosts file path on Mac OS X is /private/etc/hosts and in windows c:/windows/system32/drivers/etc...

link|improve this question
Mac, not MAC, please. – Arjan Aug 15 '10 at 15:18
feedback

migrated from stackoverflow.com Aug 15 '10 at 15:07

This question came from our site for professional and enthusiast programmers.

2 Answers

No, this is not possible.

See these related questions:

link|improve this answer
feedback

This is not possible in the hosts file. For acceptable syntax see this: /etc/hosts file

link|improve this answer
feedback

Your Answer

 
or
required, but never shown