Don't think there is any moodle plugin that does as desired. Probably better off restricting from the operating system (network layer) or apache config rather than moodle.
Please see the response to the original 2006 posting @
Have to ask though ... what's 'broken'? What are we trying to 'fix' and just how serious is the problem?
Plus ... are you hosted in such a fashion where you could control the 'network layer'?
Also ... hopefully, you are running Linux flavor of some sort.
Devil is always in the details.
'spirit of sharing', Ken