File Hosts Untuk Blok Situs

File Hosts yang berlokasi “C:\WINDOWS\system32\drivers\etc” (Windows XP) ini berfungsi untuk pemetaan IP address ke host names, itu merupakan pengertian yang terdapat dalam file hosts tersebut.

# Copyright (c) 1993-1999 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

127.0.0.1 localhost

Dengan kata lain request dns akan diteruskan berdasarkan IP yang telah ditentukan. Default isi file host ini adalah 127.0.0.1 localhost yang berarti pada saat request dns ke localhost maka akan diteruskan ke IP 127.0.0.1.
Oleh sebab itu kita bisa memanfaatkannya untuk memblok situs yang tidak diinginkan agar request tersebut di disesatkan ke IP yang ditentukan.
Misalnya menambahkan :

127.0.0.1 www.xxx.com
127.0.0.1 www.block.com

Nah itu artinya adalah mengalihkan request www.xxx.com atau www.block.com ke IP local.

Leave a Reply