शब्दकोश · ऑपरेटिंग सिस्टम और सॉफ़्टवेयर

Hosts File

The hosts file is a local text file that maps hostnames to IP addresses and is checked by the operating system before it asks a DNS server.

अपडेट: अक्टूबर 6, 2026

The hosts file is a plain-text file on your computer that maps domain names to IP addresses. Before the system queries a DNS resolver, it looks here, so entries override public DNS for that machine only. It lives at /etc/hosts on Linux and macOS and C:\Windows\System32\drivers\etc\hosts on Windows.

Why it matters

Developers use it to point a domain at a test server before a DNS change, to test a site migration or to reach local services by name. Administrators and some security tools use it to block unwanted domains by pointing them at 0.0.0.0. Malware sometimes edits it to redirect banking sites, so unexpected entries deserve attention.

Example

127.0.0.1       localhost
203.0.113.25    example.com www.example.com
0.0.0.0         ads.example.net

After saving the second line, your browser reaches 203.0.113.25 for example.com, whatever public DNS says. Editing requires administrator rights.

Common mistakes

  • Forgetting a test entry and later wondering why the live site looks different on one computer only.
  • Expecting the change to affect other devices; it applies only to the machine edited.
  • Not flushing the DNS cache or restarting the browser after editing.

Get notified when this term updates

Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.

यह पेज सामान्य जानकारी है, जिसे हमारी संपादकीय टीम ने लिखा है और दस्तावेज़ीकरण बदलने पर अपडेट किया जाता है। सर्वर और प्रदाता अलग-अलग होते हैं, इसलिए बदलाव पहले सुरक्षित तरीके से जाँचें। देखें: संपादकीय नीति और अस्वीकरण.