Resolving ip public address to 127.0.0.1

iplocalpublic

Good day all,

I'm in the process of locally testing a website and I need to replicate the production environment. This website is available on a public ip address (no domain for it yet), and I need to 'override' the public ip address with a local ip address for which I've setup a virtual host locally.

Point is, I can't 'override' the public access. I'm using windows, and I've tried using the hosts file, the 'route' and 'arp' commands, but I don't think these are the correct tools. Hosts file only accepts domains, and I might not be skilled enough to issue the proper route or arp commands.

Example:
ping 85.85.82.83 <= NOT A DOMAIN NAME
reply 127.0.0.1

So please help me redirect a public ip address to a local ip address, so that a simple 'ping' of the originally public ip address points instead to the local ip address assigned.

Thanks in advance.

Best Answer

If I catch you correctly you Are looking for a to resolve an ip Adress to local Adress. Not a domain. In windows this can be done by setting up an ip security rule. See this scribd tutorial I made long ago. It's for blocking an ip Address by redirecting it to localhost. So things will be same for you.

If you want to automate it you can use netsh or ipseccmd