I'd rather see this as a configuration value than have it determined programatically.

If this kind of processing is running on multiple hosts the IP addresses could all be different.