国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Home Common Problem What is the path to the windows hosts file

What is the path to the windows hosts file

Aug 31, 2022 pm 03:37 PM
windows hosts

The path of the hosts file is "C:\Windows\System32\drivers\etc". Hosts is a system file without an extension. Its function is to establish an associated "database" between some commonly used URL domain names and their corresponding IP addresses. When the user enters a URL that needs to be logged in in the browser, the system will first automatically start from Find the corresponding IP address in the Hosts file and open the corresponding web page; if not found, the system will submit the URL to the DNS domain name resolution server for IP address resolution.

What is the path to the windows hosts file

The operating environment of this tutorial: Windows 7 system, Dell G3 computer.

Hosts is a system file without extension, which can be opened with Notepad and other tools. Its function is to establish an associated "database" between some commonly used URL domain names and their corresponding IP addresses. When the user opens the browser When you enter a URL that needs to be logged in, the system will first automatically search for the corresponding IP address in the Hosts file. Once found, the system will immediately open the corresponding web page. If not found, the system will submit the URL to the DNS domain name resolution server for IP Address resolution.

It should be noted that the mapping configured in the Hosts file is static. If the computer on the network changes, please update the IP address in time, otherwise you will not be able to access it.

Working Principle

When a browser accesses a website, it must first resolve the domain name of the website to be accessed into its designated IP address through the DNS server. After that, the browser can Locate this website and access its data.

The operating system stipulates that before making a DNS request, first check whether there is a mapping relationship between the domain name and IP in your own Hosts file. If there is, then directly access the network location specified by this IP address. If not, then make a domain name resolution request to a known DNS server. In other words, the IP resolution priority of Hosts is higher than that of DNS.

The storage location under windows

The location of the hosts file is different in different operating systems (or even different Windows versions). The address under windows is :

C:\Windows\System32\drivers\etc

What is the path to the windows hosts file

##Opening method:

Select the file, right-click and select "notepad"

What is the path to the windows hosts file

What is the path to the windows hosts file##Windows version original host file content:

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost

If you suspect that your hosts file has been modified by a virus or Trojan, you can copy the above content to repair the hosts file.

It is worth mentioning that # is followed by comments, so clearing the hosts file has no impact on the normal operation of the system.

The role of Hosts file

1. Speed ??up domain name resolution

For websites that we want to visit frequently, we can configure the domain name and IP in Hosts Mapping relationship to improve domain name resolution speed. Due to the mapping relationship, when we enter the domain name, the computer can quickly resolve the IP without requesting the DNS server on the network.

2. Convenient for LAN users

In the LAN of many units, there will be servers available for users to use. However, since DNS servers are rarely set up in local area networks, when accessing these servers, you have to enter IP addresses that are difficult to remember. This is quite troublesome for many people. You can give these servers names that are easy to remember, and then establish IP mapping in Hosts, so that when you visit in the future, you only need to enter the name of the server.

3. Block websites (domain name redirection)

There are many websites that install various plug-ins into your computer without the user’s consent. Some of them may be Trojan horses or Virus. For these websites, we can use Hosts to map the domain name of the website to the wrong IP or the IP of the local computer, so that there is no need to access it. In the WINDOWS system, it is agreed that 127.0.0.1 is the IP address of the local computer, and 0.0.0.0 is the wrong IP address.

If we write the following content in Hosts:

127.0.0.1要屏蔽的網(wǎng)站A的域名
0.0.0.0要屏蔽的網(wǎng)站B的域名

In this way, when the computer resolves domain names A and B, it will resolve to the local IP or the wrong IP, thus blocking the website The purpose of A and B.

4. Smooth connection to the system

For Lotus servers and some database servers, if you directly enter the IP address during access, you cannot access it. You can only access it by entering the server name. Then we configure the Hosts file so that we can connect smoothly by entering the server name.

5. Virtual domain name

Many times, website builders need to build the "soft environment" before uploading and debugging. But similar to the mail service, you need to use a domain name to assist debugging. In this case, you can point the local IP address to a "virtual domain name" to achieve the required effect without any cost. For example:

127.0.0.1 網(wǎng)站域名

and then enter the corresponding website domain name in the browser address bar.

For more related knowledge, please visit the

FAQ

column!

The above is the detailed content of What is the path to the windows hosts file. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

PHP Tutorial
1502
276
How to enable Hyper-V in Windows How to enable Hyper-V in Windows Aug 04, 2025 am 12:53 AM

Hyper-VcanbeenabledonWindowsPro,Enterprise,orEducationeditionsbymeetingsystemrequirementsincluding64-bitCPUwithSLAT,VMMonitorModeExtension,BIOS/UEFIvirtualizationenabled,andatleast4GBRAM.2.EnableHyper-VviaWindowsFeaturesbyopeningoptionalfeatures,chec

How to solve touchpad not working issues on Windows? How to solve touchpad not working issues on Windows? Aug 05, 2025 am 09:21 AM

Checkifthetouchpadisdisabledbyusingthefunctionkey(Fn F6/F9/F12),adedicatedtogglebutton,orensuringit’sturnedoninSettings>Devices>Touchpad,andunplugexternalmice.2.UpdateorreinstallthetouchpaddriverviaDeviceManagerbyselectingUpdatedriverorUninstal

How to fix a '0x800f0954' error when installing optional features in Windows How to fix a '0x800f0954' error when installing optional features in Windows Aug 05, 2025 am 09:30 AM

First, run Windows Update troubleshooter to automatically repair common problems, 1. Run Windows Update troubleshooter; 2. Check network connection and proxy settings to ensure that you can access the Windows Update Server; 3. Use DISM command to repair component storage, and specify the local Windows ISO source if necessary; 4. Manually specify the ISO source path when installing optional functions through PowerShell; 5. Reset Windows Update component services and clear cache; 6. Run sfc/scannow and chkdsk to check system and disk errors; finally ensure that the system is updated to the latest and use official ISO first to solve the problem of missing files, and in most cases, you can successfully repair 0x800f0954 errors

How to restore the original system font in Windows How to restore the original system font in Windows Aug 04, 2025 am 08:46 AM

To restore Windows system fonts, please first check whether you have modified the font using a third-party tool. If so, reset the "Restore Default" option of the tool; if no tool is available, you can manually locate HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\Fonts through the registry editor to ensure that the font value of SegoeUI is correctly pointed to segoeui.ttf and other files, and back up the registry if necessary; then run the command prompt as an administrator and execute the sfc/scannow command to repair the system files; finally go to Settings → Personalization → Theme, and select Windows to light it by default.

Is mac os more secure than windows Is mac os more secure than windows Aug 05, 2025 am 09:55 AM

macOSistargetedlessduetosmallermarketshare,reducingmalwarevolume.2.Apple’stighthardware-softwareintegrationenablesstrongbuilt-insecuritylikeGatekeeper,SIP,andappsandboxing.3.Faster,moreuniformupdatesensurevulnerabilitiesarepatchedpromptly.4.macOSisno

What to do when the Windows installation is stuck What to do when the Windows installation is stuck Aug 06, 2025 am 03:45 AM

Wait1–2hoursifdiskactivitycontinues,asWindowsSetupmayappearfrozenduringfileexpansionorupdateinstallation.2.Recognizenormalslowphaseslike"Gettingdevicesready"orfirstboot.3.Forcerestartonlyafter2 hoursofnoactivitybyholdingthepowerbutton.4.Use

How to enable efficiency mode for apps in Windows How to enable efficiency mode for apps in Windows Aug 03, 2025 pm 04:38 PM

Windows does not have a direct “efficiency mode” switch, but similar effects can be achieved through a variety of built-in functions. 1. Use Task Manager: Press Ctrl Shift Esc to open, right-click the target application and select "Go to Details", then right-click the process to select "Set Priority" to "Lower than Normal" or "Low" to reduce CPU usage, and disable unnecessary power-on and self-start programs in the "Startup" tab. 2. Enable battery saver or power efficiency mode: Click the battery icon in the taskbar to turn on the battery saver, or automatically enable it through the "Settings > System > Power and Battery" setting, which can limit background activity, slow application synchronization and reduce visual effects. 3. Manage background application permissions: Go to "Settings>

How to check for memory problems in Windows How to check for memory problems in Windows Aug 04, 2025 am 06:23 AM

StartwithWindowsMemoryDiagnosticbyrunningmdsched.exetocheckforRAMissueseitherimmediatelyoratnextboot,thenreviewresultsinEventViewerunderWindowsLogs>SystemforMemoryDiagnostics-Results.2.UseTaskManager(Ctrl Shift Esc)tochecktotalandcurrentmemoryusag