Categories
blog Hosts

Editing Hosts File

very simple methodย and works if the site is blocked by counter method or if you know the IP address of the website (you want to unblock). Simply open /etc/hosts file and remove the entry for your favorite websites and flush the DNS cache to propagate the changes.

gksu gedit /etc/hosts

In other case if you know the IP address of target website, which blocked using some other mechanism such as ISP level or something else then add an entry (/etc/hosts) for that website along with the correct IP address. The second method seems to be logically correct โ€“ if a domain name is resolved at host level then the lookup process is terminated, so host level dns entry should bypass other DNS filtering e.g at ISP level.ย Therefore it is expected to work (but I have not tested yet, Iโ€™ll let you know if it works), give it a try it may work. But it may not work if the websiteโ€™s IP address changes frequently โ€“ because in that case it would be difficult to update the etc/hosts file manually to reflect the new value of IP address.

Adding a DNS entry in etc/hosts file โ€“

TARGET_IP_ADDRESS ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  TARGET_WEBSITE_DOMAIN_NAME

Then execute the following command โ€“ (to flush DNS cache)

sudo apt-get install nscd
sudo /etc/init.d/nscd restart

 

This website stores cookies on your computer. These cookies are used to provide a more personalized experience and to track your whereabouts around our website in compliance with the European General Data Protection Regulation. If you decide to to opt-out of any future tracking, a cookie will be setup in your browser to remember this choice for one year.

Accept or Deny