Windows 10 Edit Hosts file

摘要: In this tutorial, we will show you how to add a mapping of IP addresses to host names in the Windows Hosts file.

In this tutorial, we will show you how to add a mapping of IP addresses to host names in the Windows Hosts file.

Windows Hosts file
C:\Windows\System32\drivers\etc\hosts

1. Notepad – Run as Administrator

In desktop, left-bottom search box, type notepad, right click on the notepad icon and select run as administrator.

2. Edit hosts

2.1 In Notepad (make sure run as administrator), locate and open the following file :

C:\Windows\System32\drivers\etc\hosts

P.S In the open file dialog, select “All Files (*.*)”

2.2 Add a mapping of IP address to host name.

C:\Windows\System32\drivers\etc\hosts
# Copyright (c) 1993-2009 Microsoft Corp.
#...
# localhost name resolution is handled within DNS itself.
#	127.0.0.1       localhost
#	::1             localhost
#add this new line
45.56.65.145 linode-hydra

3. Test It

In command prompt, ping linode-hydra, now it will return 45.56.65.145

Command Prompt
C:\Users\mkyong>ping linode-hydra
Pinging linode-hydra [45.56.65.145] with 32 bytes of data:
Reply from 45.56.65.145: bytes=32 time=276ms TTL=51
Reply from 45.56.65.145: bytes=32 time=278ms TTL=51
Reply from 45.56.65.145: bytes=32 time=279ms TTL=51
Ping statistics for 45.56.65.145:
    Packets: Sent = 3, Received = 3, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 276ms, Maximum = 279ms, Average = 277ms

References

  1. Wikipedia Hosts file
  2. Modify your hosts file

上一篇: Java 8 – Stream Collectors groupingBy examples
下一篇: Java How to override equals and hashCode
 评论 ( What Do You Think )
名称
邮箱
网址
评论
验证
   
 

 


  • 微信公众号

  • 我的微信

站点声明:

1、一号门博客CMS,由Python, MySQL, Nginx, Wsgi 强力驱动

2、部分文章或者资源来源于互联网, 有时候很难判断是否侵权, 若有侵权, 请联系邮箱:summer@yihaomen.com, 同时欢迎大家注册用户,主动发布无版权争议的 文章/资源.

3、鄂ICP备14001754号-3, 鄂公网安备 42280202422812号