top of page

Subscribe to Wisdom

Thanks for Subscribing!

  • Writer's pictureDimit Chadha

How to Map IP to DNS for Testing

Normally whenever we build web applications using any agreed technology stack , we endup in access url like http://<server ip/hostname>:portnumber/myapp. If you have many applications hosting on different servers ,it’s difficult to remember IP or hostname for that server.

Work around is to have dummy or fake Domain name (not registered with any registar)

e.g. http://<server ip/hostname>:portnumber/myapp changes to http://www.myapp.com/myapp


To make it happen we would simply modify hosts file, which is essentially a list of IP/hostname associations which any DNS lookup will check first.


Host file is located at different locations in different OS. For windows it resides in c:/windows/system32/drivers/etc/ folder . Make sure you open host file (hosts) in admin mode to save changes.


In hosts file find the entry for localhost and add an entry as shown below


127.0.0.1       www.myapp.com

All set, access your application as http://www.myapp.com/myapp

29 views0 comments

Recent Posts

See All

Comments


Modern Digital Watch
bottom of page