• Hosts文件的使用


    hosts文件是什么?在哪里?
    hosts文件:系统文件,可以记事本打开并编辑。
    一般用于域名到ip地址的解析。当用户在浏览器中输入网络的域名时,系统首先会自动从hosts文件中找到对应的ip地址,一旦找到,将用该ip地址打开对应的网页。如果没有找到,则系统会在将网址提交到DMS域名解析服务器进行ip地址的解析。
    Windows系统hosts位于 C:WindowsSystem32driversetchosts(需要管理员权限)
    Android(安卓)系统hosts位于 /system/etc/hosts(需要root)

    windows的默认hosts文件

    # 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

    修改hosts后生效的方法

    cmd中执行

    ipconfig /flushdns

    当然重启系统等措施也行。

  • 相关阅读:
    [No0000F0]DataGrid一行Row添加ToolTip,wpf
    [No0000EE]主要的宏观经济指标查询
    [No0000E9]Microsoft Help Viewer 2.3绿色版
    [No0000F2]ip安全监视器
    [No0000ED]IPSec策略之管理
    [No0000EC]C# 字符串(String)
    [No0000EB]C# 数组(Array)
    [No0000EA]C# 可空类型(Nullable)
    [No0000E8]C# 方法 参数传递
    [No0000E7]C# 封装 与访问修饰符
  • 原文地址:https://www.cnblogs.com/zadomn0920/p/6159684.html
Copyright © 2020-2023  润新知