Suatu saat, kita perlu memanggil domain di komputer localhost kita untuk menguji hosting yang telah di bangun secara offline. Atau ingin mendemonstrasikan secara real kepada orang lain website yang telah kita design dengan memanggil domain website tersebut dikomputer yang tersintal Windows XP.
Nah, namanya apa tu? DNS Resolve ? Domain Name Server pada XP ? Domain Cache ? Yah, … pokoknya seperti itu,
Ini ada tips yang mungkin bisa digunakan. Syarat: XAMPP terinstall, atau apache dsb.
Carilah folder ini:
C:\WINDOWS\system32\drivers\etc\
lalu buka lah file yang bernama:
host
(caranya? klik kanan + shift > open with > wordpress / notepad)
lalu anda akan mendapatkan file yang telah tersisi:
# 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
###########################################end
setelah baris terakhir, “127.0.0.1 localhost”, tambahkan domain yang anda inginkan di awali dengan IP nya, atau jika ingin localhost, tulis saja IP loopback ( 127.0.0.1 )
Jadi kira2 isi file tsb seperti ini:
# 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
127.0.0.1 www.namasaya.com
127.0.0.1 www.google.com
###########################################end
Lalu jangan lupa untuk di SAVE, dgn menekan CTRL+S
Nah silahkan dicoba. Jika belum ada hasil, sebaiknya lakukan restart.
Mudah2 an bermanfaat.