HACKER Q&A
📣 mardiyah

How's actually /etc./hosts working? Govt-censored ISP Problem is solved


How actually does /etc/hosts work

Ruinous government-censored ISP problem is solved simply by feeding the ip info !?


  👤 enz Accepted Answer ✓
/etc/hosts let the system bypass DNS resolution step when the entry you are looking for is in that file. However, this is the case only if the software uses the standard POSIX call to do that (gethostbyname) and if the system is configured to behave that way (which should be the case).

Other software may bypass the system-level resolution for various reasons. (e.g. a software using DNS over HTTPS)

In addition to this, modern websites may have their IP addresses to change often because they are behind a CDN/proxying service like Cloudflare, Cloudfront, ... That is, continuously updating the /etc/hosts file by hand may be very tiring.