Base URL for all external links
This sounds like an unfortunate build decision coming back to hurt maintenance; that in itself is a common occurrence.  One phrase I must repeat here is "if things dont go as you planned, you have had an experience."  The issue that you have, at least in the school I went to, is called a Magic Number Unique values with unexplained meaning or multiple occurrences which could (preferably) be replaced with named constants

Now, solutions.  If you just want to plaster on more code to resolve this, then look at the External Links module.  This module adds javascript that checks every link on your site to see if they use the site's base url, and if not it adds an image to indicate the link goes elsewhere.  You could modify this code (the joys of open source) to change the IP from the old to the new.  This is what I would consider a weak solution.  It gets the desired result but it adds more code and processing to the site, and doesn't truly fix the root issue.

A better method would be to define a site variable ( code example ) to hold the ip address and then go and edit all of the references to it throughout the entire site to use that variable instead.  This works if all of the links are generated in php somewhere, and not just hard-coded in the body field of various nodes.  The advantage here is, if that ip address changes again you only have to update the variable value.  That can even be done with a drush vset.

Now, assuming these links are in node bodies and do not have the ability to use a php variable, you can get a similar result with a hook.  I would still recommend setting the new ip in a variable.  Then using a hook_node_view you can preg_replace the old ip address with the contents of the variable in the whole body field for any node.  Or in other fields too, or only on nodes of if( in_array( $node-&gt;type, $target_types_array)) etc.  This has the advantage of similar flexibility to the variable solution, but it does add extra processing like the javascript solution.  However, it is a hook that does not need loops so it will not be much of an increase.