Sunday, June 4, 2017

Local DNS resolution

We can always run a DNS server and resolve a URL/URI to a specific IP address. But in development  environment there is no point running a beast to resolve url to ip address.

Let's say your URL :
IP address :

So there is an easy alternative if you don't want to modify your source code and change the IP address.
You can add entry in /etc/hosts

MacBook-Pro-2:~ Siddheshwar$ sudo vi /etc/hosts
# Host Database
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##        localhost broadcasthost
::1 localhost
# BEGIN section for OpenVPN Client SSL sites
# END section for OpenVPN Client SSL sites

:wq (enter)
to save

No comments:

Post a Comment