how to set etc/hosts file in windows 7

simonc

New member
Local time
4:02 AM
Messages
8
I updated the Windows\System32\drivers\etc\hosts file to include static ip addresses of computers on my local network; just like I do it in Vista and XP. But now I tried to access the computers by name, it complains that host 'xyz' cannot be resolved. Why?

Simon
 

My Computer My Computer

At a glance

windows7
OS
windows7
Maybe you have Bonjour service on your pc? Check for mdnsresponder.exe in task manager.

Are you able to access the remote pcs by ip address?

make sure that

127.0.0.1 localhost

it the first entry in the hosts file. Must be first.
 

My Computer My Computer

At a glance

7600.20510 x86P4 550 3.4 GHz HT running at 3.5 GHzOCZ 2 GB(2x1GB) DDR400mHz running @ 414 mHzHIS Radeon HD 3850 IceQ 3 Turbo HDMI Dual DL-...
Computer Manufacturer/Model Number
self built
OS
7600.20510 x86
CPU
P4 550 3.4 GHz HT running at 3.5 GHz
Motherboard
MSI PM8M3-V (MS-7211 v1.x) Micro-ATX mainboard
Memory
OCZ 2 GB(2x1GB) DDR400mHz running @ 414 mHz
Graphics Card(s)
HIS Radeon HD 3850 IceQ 3 Turbo HDMI Dual DL-DVI AGP
Sound Card
MOTU Traveler firewire studio interface 192 kHz 24 bit
Monitor(s) Displays
22" widescreen Acer X223W LCD, 17" Compaq P75 CRT
Screen Resolution
1680x1050 and 1280x1024
Hard Drives
SATA I x2 WD, 400 GB and 120 GB, SATA 2 WD Caviar Black 1 TB
PSU
350W generic
Case
Cybertronpc, it glows blue
Cooling
stock cpu fan, Ice-Q 3 gpu and system, many case fans
Keyboard
Logitch Classical Keyboard 200
Mouse
Logitech Mediaplay cordless
Internet Speed
1792/448 kbits/sec
Other Info
SATA II PCI fake RAID adapter, 1 GB Readyboost, original ATI Remote Wonder (even works with WMC perfectly), Logitech Rumblepad 2 game controller x2
You should not need to do that unless the other computers are not Windows computers. Windows automatically resolves computer names to IPs for those that respond to NetBIOS. Are you positive the items added to the hosts file were in fact saved? Are they correct? The hosts file is no different in how it was in previous versions of Windows.
 

My Computer My Computer

At a glance

Windows 10 Pro (x64)Intel Core i7-3930K (3.2GHz - 4.5GHz)4x Samsung 4GB PC3-12800 DDR3 (16GB 1600MHz)Nvidia Geforce GTX 690
Computer type
PC/Desktop
Computer Manufacturer/Model Number
Alienware Aurora ALX R4
OS
Windows 10 Pro (x64)
CPU
Intel Core i7-3930K (3.2GHz - 4.5GHz)
Motherboard
Alienware Aurora-R4 x79
Memory
4x Samsung 4GB PC3-12800 DDR3 (16GB 1600MHz)
Graphics Card(s)
Nvidia Geforce GTX 690
Sound Card
SteelSeries Siberia Elite
Monitor(s) Displays
Dell UltraSharp U3011
Screen Resolution
2560x1600
Hard Drives
Samsung 850 Pro 256 GB, Seagate 1TB Desktop Hybrid HDD, 2x Western Digital 4TB Green HDD
PSU
875W Some Dell PSU <.<
Case
Alienware Aurora ALX
Cooling
Custom Liquid Cooling (EK CPU & GPU blocks) dual EK 480RAD
Keyboard
Logitech G710+ Mechanical
Mouse
Logitech G700s
Internet Speed
Verizon Fios (50 mbps average)
Other Info
Server: Intel NUC D54250WYK: i5-4250U, 16GB, 256 GB mSATA, Windows Server 2012 R2
It's cool to do that like for instance if you just want to type

router

or

bedroompc

in the browser url box and hit enter, you're there. Necessity? No. Simplicty? Yes.
 

My Computer My Computer

At a glance

7600.20510 x86P4 550 3.4 GHz HT running at 3.5 GHzOCZ 2 GB(2x1GB) DDR400mHz running @ 414 mHzHIS Radeon HD 3850 IceQ 3 Turbo HDMI Dual DL-...
Computer Manufacturer/Model Number
self built
OS
7600.20510 x86
CPU
P4 550 3.4 GHz HT running at 3.5 GHz
Motherboard
MSI PM8M3-V (MS-7211 v1.x) Micro-ATX mainboard
Memory
OCZ 2 GB(2x1GB) DDR400mHz running @ 414 mHz
Graphics Card(s)
HIS Radeon HD 3850 IceQ 3 Turbo HDMI Dual DL-DVI AGP
Sound Card
MOTU Traveler firewire studio interface 192 kHz 24 bit
Monitor(s) Displays
22" widescreen Acer X223W LCD, 17" Compaq P75 CRT
Screen Resolution
1680x1050 and 1280x1024
Hard Drives
SATA I x2 WD, 400 GB and 120 GB, SATA 2 WD Caviar Black 1 TB
PSU
350W generic
Case
Cybertronpc, it glows blue
Cooling
stock cpu fan, Ice-Q 3 gpu and system, many case fans
Keyboard
Logitch Classical Keyboard 200
Mouse
Logitech Mediaplay cordless
Internet Speed
1792/448 kbits/sec
Other Info
SATA II PCI fake RAID adapter, 1 GB Readyboost, original ATI Remote Wonder (even works with WMC perfectly), Logitech Rumblepad 2 game controller x2
127.0.0.1 localhost
::1 localhost
192.168.0.110 pmachine
Bonjour Service is running under the 'Services' tab, how do i disable it?
 

My Computer My Computer

At a glance

windows7
OS
windows7
The other machine is a linux server
 

My Computer My Computer

At a glance

windows7
OS
windows7
Access to remote address by ip works fine
 

My Computer My Computer

At a glance

windows7
OS
windows7
I updated the Windows\System32\drivers\etc\hosts file to include static ip addresses of computers on my local network; just like I do it in Vista and XP. But now I tried to access the computers by name, it complains that host 'xyz' cannot be resolved. Why?

Simon

Hi and welcome

how about a description or screenshot of the hosts file?

thanks

Kenn J++
 

My Computer My Computer

At a glance

Win 8 Release candidate 8400[email protected]4 gigsNvidia 9600M
Computer Manufacturer/Model Number
HP Pavillion dv-7 1005 Tx
OS
Win 8 Release candidate 8400
CPU
[email protected]
Memory
4 gigs
Graphics Card(s)
Nvidia 9600M
Sound Card
HD built-in
Monitor(s) Displays
17" Wxga
Screen Resolution
1440x900
Cooling
none
Internet Speed
45Mb down 5Mb up
hi Kenn,

I posted earlier there are only 3 lines
127.0.0.1 localhost
::1 localhost
192.168.0.110 pmachine

file location is Windows\System32\drivers\etc\hosts
someone had mentioned that bonjour service messes up the hostname mapping, are you aware?
 

My Computer My Computer

At a glance

windows7
OS
windows7
From an elevated command prompt, run these commands and hit enter after each. You may copy/paste them:

“%PROGRAMFILES%\Bonjour\mDNSResponder.exe” -remove

regsvr32 /u “%PROGRAMFILES%\Bonjour\mdnsNSP.dll”

Reboot and then delete the Bonjour folder in program files. Problem solved.
 

My Computer My Computer

At a glance

7600.20510 x86P4 550 3.4 GHz HT running at 3.5 GHzOCZ 2 GB(2x1GB) DDR400mHz running @ 414 mHzHIS Radeon HD 3850 IceQ 3 Turbo HDMI Dual DL-...
Computer Manufacturer/Model Number
self built
OS
7600.20510 x86
CPU
P4 550 3.4 GHz HT running at 3.5 GHz
Motherboard
MSI PM8M3-V (MS-7211 v1.x) Micro-ATX mainboard
Memory
OCZ 2 GB(2x1GB) DDR400mHz running @ 414 mHz
Graphics Card(s)
HIS Radeon HD 3850 IceQ 3 Turbo HDMI Dual DL-DVI AGP
Sound Card
MOTU Traveler firewire studio interface 192 kHz 24 bit
Monitor(s) Displays
22" widescreen Acer X223W LCD, 17" Compaq P75 CRT
Screen Resolution
1680x1050 and 1280x1024
Hard Drives
SATA I x2 WD, 400 GB and 120 GB, SATA 2 WD Caviar Black 1 TB
PSU
350W generic
Case
Cybertronpc, it glows blue
Cooling
stock cpu fan, Ice-Q 3 gpu and system, many case fans
Keyboard
Logitch Classical Keyboard 200
Mouse
Logitech Mediaplay cordless
Internet Speed
1792/448 kbits/sec
Other Info
SATA II PCI fake RAID adapter, 1 GB Readyboost, original ATI Remote Wonder (even works with WMC perfectly), Logitech Rumblepad 2 game controller x2
Problem resolved: it has nothing to do with Bonjour.

the file hosts is saved as hosts.bak or hosts.txt by Notepad!!!!

use gvim instead.

btw, how do you turn on file extension in windows 7?

Simon
 

My Computer My Computer

At a glance

windows7
OS
windows7
That's why you use save as, then change "text documents" to "all files" in notepad.

You could tell when something is wrong when it doesn't ask to overwrite the original file.

Glad it's fixed.
 

My Computer My Computer

At a glance

7600.20510 x86P4 550 3.4 GHz HT running at 3.5 GHzOCZ 2 GB(2x1GB) DDR400mHz running @ 414 mHzHIS Radeon HD 3850 IceQ 3 Turbo HDMI Dual DL-...
Computer Manufacturer/Model Number
self built
OS
7600.20510 x86
CPU
P4 550 3.4 GHz HT running at 3.5 GHz
Motherboard
MSI PM8M3-V (MS-7211 v1.x) Micro-ATX mainboard
Memory
OCZ 2 GB(2x1GB) DDR400mHz running @ 414 mHz
Graphics Card(s)
HIS Radeon HD 3850 IceQ 3 Turbo HDMI Dual DL-DVI AGP
Sound Card
MOTU Traveler firewire studio interface 192 kHz 24 bit
Monitor(s) Displays
22" widescreen Acer X223W LCD, 17" Compaq P75 CRT
Screen Resolution
1680x1050 and 1280x1024
Hard Drives
SATA I x2 WD, 400 GB and 120 GB, SATA 2 WD Caviar Black 1 TB
PSU
350W generic
Case
Cybertronpc, it glows blue
Cooling
stock cpu fan, Ice-Q 3 gpu and system, many case fans
Keyboard
Logitch Classical Keyboard 200
Mouse
Logitech Mediaplay cordless
Internet Speed
1792/448 kbits/sec
Other Info
SATA II PCI fake RAID adapter, 1 GB Readyboost, original ATI Remote Wonder (even works with WMC perfectly), Logitech Rumblepad 2 game controller x2

My Computer My Computer

At a glance

W 7 64-bit UltimateIntel Q9550 Yorkfield8GB Dominator 8500C5DATI : XFX 5870
Computer Manufacturer/Model Number
* BFK Customs *
OS
W 7 64-bit Ultimate
CPU
Intel Q9550 Yorkfield
Motherboard
ASUS P5Q Pro
Memory
8GB Dominator 8500C5D
Graphics Card(s)
ATI : XFX 5870
Sound Card
Realtek HD Audio 7-1
Monitor(s) Displays
1x 47" LCD HDMI & 3x 26" LCD HDMI
Screen Resolution
1920x1080P & 1920x1200
Hard Drives
1x 80GB Intel X25-M G2 SSD : 1x 500GB & 1x 640GB WD Caviar Black(s)
PSU
Corsair 620HX
Case
Cooler Master RC-690
Cooling
Tuniq Tower 120, 2x 140mm and 3x 120mm case fans
Keyboard
Microsoft 500
Mouse
Razer Diamondback 3G
Internet Speed
14 Mb/s
Other Info
1x Koutech 3Gb/s SATA HDD Hot Swap Rack
Back
Top