• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.
  • The forums have been upgraded with support for dark mode. By default it will follow the setting on your system/browser. You may override it by scrolling to the end of the page and clicking the gears icon.

Editing the hosts file in Windows 7

Joined
Mar 22, 2008
Messages
580 (0.09/day)
System Name X-Class MKII
Processor Intel Core i7-6950X Extreme Edition 4.60GHz 25MB Cache 14nm LGA2011-3 Broadwell-E 10-Core Processor
Motherboard EVGA Intel X99 Classified Dual Quad-Channel DDR4 Socket LGA2011-3 E-ATX Motherboard on BIOS v2.09
Cooling BP Summit M CPU WB/BP EVGA K|NGP|N FCWB/Nemesis 480GTR/Nemesis 560GTR/MMRS 150mm/Swiftech MCP655
Memory Corsair Dominator Platinum 128GB (8×16GB) @ 2800MHz 14-16-16-36 DDR4 PC4-22400 Memory Kit
Video Card(s) EVGA nVidia GeForce GTX 1080 Ti K|NGP|N 2139MHz 11264MB @ 12992MHz GDDR5X Video Cards in 2-Way SLI
Storage Samsung 970 PRO M.2 1TB NVMe V-NAND SSD on AquaComputer kryoM.2 PCIe 3.0 ×4 M.2 Adapter
Display(s) LG 34GN850-B 34” UltraGear 21:9 WQHD Nano IPS 1ms 144Hz HDR Gaming Monitor
Case CaseLabs MAGNUM SMA8 Gunmetal Single Wide Full-Tower Chassis with Custom Smoke Window Panel
Audio Device(s) Creative Sound Core3D On-Board 5.1 Surround Sound Quad-Core Audio Processor
Power Supply Corsair Professional Series AX1500i 1500-Watt 80+ TITANIUM Fully-Modular Digital Power Supply Unit
Mouse Logitech G502 PROTEUS SPECTRUM Core 200-12000DPI Laser Gaming Mouse
Keyboard Logitech G19 Gaming Keyboard with Full Color GamePanel LCD
Software Microsoft Windows 10 Professional 64-bit
I recently just upgraded to Windows 7 Ultimate 64-bit Edition and I need to edit the hosts file located in C:\Windows\System32\drivers\etc\. I've done this before on XP and Vista Ultimate 64-bit by opening the hosts file with Notepad. Only this time, when I opened it up with Notepad on Windows 7, it looked like this:

Code:
# 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

Where as on XP and Vista, it would look like this:

Code:
Copyright (c) 1993-2008 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

So if I were to insert a line into the hosts file in Windows 7, would I have to add the # before the line or can I just simply put the line in without adding the # before it?
 
yes you would
 
Back
Top