Hosts File

Injust

Banned
Local time
1:40 AM
Messages
418
Hey,
I was wondering, is there any internet performance gain if you put a commonly used website's IP (like Google) in your Hosts file, so it doesn't need to ask a DNS server? I mean, because I have 30 websites I go on at least 10 times each day, and it lags when I open all of them :D

Thanks!
 

My Computer

OS
N/A

My Computer

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
Nope. Many people use the Hosts file to block websites by redirecting them to 127.0.0.1, which redirects to localhost, going nowhere.
When the browser contacts a DNS server to find the IP, I'm using the Hosts file to remove that action. Google's IP is 173.194.75.94. I can enter "google.ca 173.194.75.94" in the Hosts file, and my browser won't need to contact a DNS server to fetch the IP, thus speeding up the loading process.

However, this is just an assumption. I need this to be verified.
Also, I know that there is the risk of a website's IP being changed :D

But thanks for helping.
 

My Computer

OS
N/A
See, Wikipedia says that Hosts files are used to "map hostnames to IP addresses". It can be used to map any website to a non-functioning IP address, in this case 127.0.0.0, but it can also be used to map the proper address :D
 

My Computer

OS
N/A
Helping is my pleasure mate, I learn that way too.


I'm not sure if using the Hosts File that way would work for what you want or not, though one thing I know is some sites have sever IP and that may cause issues and make it more trouble than it's worth.
 

My Computer

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
Yeah...that's slightly problematic...
 

My Computer

OS
N/A
Instead of tinkering with hosts file, save the frequently used websites in to bookmarks in your browser and change the url to it's IP address in the bookmark properties. But I don't think you're going to save a lot of time in opening the websites.

You would be better off requesting your ISP for another DNS server's addresses.
 

My Computer

Computer Manufacturer/Model Number
Toshiba Satellite P775-S7232
OS
MS Windows 7 Ultimate 64-bit SP1
CPU
i5-2410M 2.3GHz (2.9GHz Turbo-Boost) Sandy Bridge 32nm
Motherboard
Toshiba PHRAA ver. PSBY1U-00F003
Memory
4GB+4GB Samsung DDR3 PC3-10700 (1333 MHz)
Graphics Card(s)
Video Intel(R) HD Graphics Family, 1696MB available memory
Sound Card
Realtek High Definition Audio version=6.0.1.6323
Monitor(s) Displays
17.3 " Trubrite TFT LCD, LED Backlit
Screen Resolution
1600x900 32 bit, Native support for 720P content
Hard Drives
TOSHIBA MK6476GSXN
580.614 [GB] partitioned C: 80GB and D: 500GB with hidden recovery partitons.

Spare bay for 2nd HDD but no SATA connector :-(
PSU
Toshiba AC/DC Adapter
Case
Notebook
Cooling
Built-in Fan
Keyboard
Premium Raised Tile keyboard
Mouse
Logitech M215 wireless mouse
Internet Speed
Not fast enough
Other Info
Built-in Harman Kardon speakers with Dolby Advanced Audio, Waves MaxxAudio® 3. HDMI, 1xUSB3+3xUSB2 ports, WebCam, Battery life 4hrs 11mins, 4GB Readyboost SDHC card, WD My Book Essential Ext HDDs 2 TB, 2x1TB, My Passport SE 1TB and WDTV 1st Gen for Multimedia playing on a Sony Wega 32" LCD.
Recent addition to my toys are Asus Transformer Pad TF300T with 32GB onboard sd card + 32GB microsd card.
Windows already caches DNS records when you use them. So no adding them to the hosts file will not help any.
Open a Command Prompt and type "ipconfig /displaydns" that will show you all the entries that are cached.
 

My Computer

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
You can but ...

Injust said:
Hey,
I was wondering, is there any internet performance gain if you put a commonly used website's IP (like Google) in your Hosts file, so it doesn't need to ask a DNS server? I mean, because I have 30 websites I go on at least 10 times each day, and it lags when I open all of them
biggrin.gif

You can put any sites you want in your Hosts file, but I'm not sure how much performance benefit there would be.

Bare Foot Kid said:
Perhaps I'm not understanding your question, the Hosts File blocks web-sites.

IIRC, before DNS servers you had to put sites in your Hosts file (for name resolution).

You can use it to:

  • Replace a DNS request
  • Block a website.
The entries don't even have to be "real" sites.

In my networking course, we had to add a "fake" site the Hosts file, because the TAFE campus doesn't allow students to modify their DNS server.
The "fake" site was a dummy website that we had created on a virtual server.

Windows already caches DNS records when you use them. So no adding them to the hosts file will not help any.
Open a Command Prompt and type "ipconfig /displaydns" that will show you all the entries that are cached.

It would stop the first DNS request being sent though (i.e. they won't be forgotten when you shutdown). :)
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
n/a
OS
W7 Ultimate SP1, LM19.2 MATE, W10 Home 1703, W10 Pro 1703 VM, #All 64 bit
CPU
AMD Phenom II x6 1100T, 3.3 GHz
Motherboard
ASUS M4A88T-M/USB3 (AM3)
Memory
12GB DDR3 1333 G-Skill (4GB x 2), G-Skill (2GB x 2)
Graphics Card(s)
NVIDIA GeForce GTX 660
Sound Card
Realtek?
Monitor(s) Displays
Samsung S23B350
Screen Resolution
1920x1080
Hard Drives
WD Green 2TB (SATA), WD Green 3TB (SATA), WD Blue 4TB (SATA), WD Blue 6TB (SATA)
PSU
Cooler Master
Case
Antec GX300 Tower
Cooling
3x Antec TRICOOL 120mm Fans
Mouse
Wired Optical
Internet Speed
DSL
Antivirus
Avast
Browser
Pale Moon (64 bit)
Other Info
2018-12-27 Upgraded HDDs
2015-12-10 Upgraded case, graphics card, storage
2015-08-15 Upgraded motherboard & RAM
2015-07-15 Upgraded LM17.1 to LM17.2
Windows already caches DNS records when you use them. So no adding them to the hosts file will not help any.
Open a Command Prompt and type "ipconfig /displaydns" that will show you all the entries that are cached.

BTW, when I enter ipconfig /displaydns in CMD, this comes up :P
 

Attachments

  • CMD.png
    CMD.png
    19.3 KB · Views: 38

My Computer

OS
N/A

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
n/a
OS
W7 Ultimate SP1, LM19.2 MATE, W10 Home 1703, W10 Pro 1703 VM, #All 64 bit
CPU
AMD Phenom II x6 1100T, 3.3 GHz
Motherboard
ASUS M4A88T-M/USB3 (AM3)
Memory
12GB DDR3 1333 G-Skill (4GB x 2), G-Skill (2GB x 2)
Graphics Card(s)
NVIDIA GeForce GTX 660
Sound Card
Realtek?
Monitor(s) Displays
Samsung S23B350
Screen Resolution
1920x1080
Hard Drives
WD Green 2TB (SATA), WD Green 3TB (SATA), WD Blue 4TB (SATA), WD Blue 6TB (SATA)
PSU
Cooler Master
Case
Antec GX300 Tower
Cooling
3x Antec TRICOOL 120mm Fans
Mouse
Wired Optical
Internet Speed
DSL
Antivirus
Avast
Browser
Pale Moon (64 bit)
Other Info
2018-12-27 Upgraded HDDs
2015-12-10 Upgraded case, graphics card, storage
2015-08-15 Upgraded motherboard & RAM
2015-07-15 Upgraded LM17.1 to LM17.2
Unless you're in a situation in which your specific DNS server is extremely slow, the DNS request and response is an exponentially small fraction of the entire web page fetching process. If all of your pages lag and take time to load, that is most likely more of a bandwidth issue than a DNS issue. However, to rule it out, change your DNS server to something else like UltraDNS or Google's DNS server and see if that helps any.
 

My Computer

OS
XP / Win7 x64 Pro
CPU
Intel Quad-Core Q9450 @ 3.2GHz
Motherboard
Asus P5-E
Memory
2x2GB GSkill DDR2
Graphics Card(s)
NVIDIA GeForce 8600 GTS (EVGA)
Monitor(s) Displays
Dell 2408WFP
Screen Resolution
1920x1200
Yeah, I'm using Google DNS, and I have tons of bandwith, but still lagging :P
 

My Computer

OS
N/A
What security software are you running? Antivirus, firewall?
 

My Computer

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
Browser plugins? Maybe you can describe the lag a bit more in depth as that's a very subjective term.
 

My Computer

OS
XP / Win7 x64 Pro
CPU
Intel Quad-Core Q9450 @ 3.2GHz
Motherboard
Asus P5-E
Memory
2x2GB GSkill DDR2
Graphics Card(s)
NVIDIA GeForce 8600 GTS (EVGA)
Monitor(s) Displays
Dell 2408WFP
Screen Resolution
1920x1200
Browser plugins? Maybe you can describe the lag a bit more in depth as that's a very subjective term.

K, took many screenshots of "about:plugins" and edited them into one :D
 

Attachments

  • Plugins.png
    Plugins.png
    177.3 KB · Views: 11

My Computer

OS
N/A
Since you are using Chrome, it defiantly is not a DNS issue, Chrome maintains its own DNS cache. It also prefetches DNS records before you use them.
 

My Computer

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
Can you describe in specific detail what the situations are in which the lag occurs and what exactly you're interpreting as lag? Basically walk us through every step of what happens.
 

My Computer

OS
XP / Win7 x64 Pro
CPU
Intel Quad-Core Q9450 @ 3.2GHz
Motherboard
Asus P5-E
Memory
2x2GB GSkill DDR2
Graphics Card(s)
NVIDIA GeForce 8600 GTS (EVGA)
Monitor(s) Displays
Dell 2408WFP
Screen Resolution
1920x1200
Back
Top