You are on page 1of 6

Cc th thut hu ch vi file Hosts

File Hosts trong Windows cho php bn xc nh tn min ca trang web c lin kt vi a ch IP. Hn na, cc lin kt ny c u tin hn DNS, do mt vi DNS server ch cho php trang facebook lin kt n nhng a ch IP nht nh, nhng bn vn c th chnh sa file Hosts cho php lin kt facebook n bt k a ch IP no, cng l cch vo facebook hiu qu nht hin nay. Bn cnh , vic chnh sa file Hosts cn c nhiu tnh nng hu ch khc.

Trc tin, chnh sa c file Hosts, bn phi khi chy notepad (hoc bt k phn mm chnh sa vn bn no khc) bng cch chn Run as Administrator. Sau khi mt trang notepad mi hin ra, vo File > Open ri dn n a ch C:\Windows\System32\drivers\etc, chn hin th All File v kch p vo tp tin Hosts. Cch thc hin ny s hn ch li khi lu file Hosts ca bn so vi cch thng thng l chut phi vo file Hosts v chn open with ... Chn mt website Bn ch cn thm vo dng lnh: 127.0.0.1 abc.com

Trong : abc.com l trang web m bn mun chn. Cch thc hot ng ca n l khi bn truy cp a ch abc.com, my tnh ca bn s b iu hng truy cp n chnh my tnh ca bn (127.0.0.1). Trong khi my tnh ca bn khng c mt my ch web, do kt ni s tht bi. Bin php ny rt hu hiu cho cc bn mun ngn chn s kim duyt t cc hng vi phn mm ca mnh, ch cn n gin l chn cc lin kt n trang web ca phn mm . To phm tt cho mt website

Bn c th to mt phm tt cho mt trang web a thch, mi ln mun truy cp bn ch cn n phm tt vo thanh a ch v enter, khng cn ghi y tn mt trang web. lm c iu ny, bn cn bit a ch IP ca trang web m bn mun to phm tt. Vo Start, g Command Promp > Enter, ca s Command Promp s hin ra. Ti y g vo lnh: ping website_bn_mun_tm_IP ri enter, v d nh: ping google.com. a ch IP ca trang web s hin ngay dng u tin.

Cng vic cn li ch l nhp vo dng lnh sau: a_ch_IP_website phm_tt_bn_mun_chuyn vo file Hoste, v d nh: 74.125.128.113 G. Sau khi lu li, kt qu mi ln truy cp bn ch cn g G ln thanh a ch v n enter, trnh duyt s t ng dn n trang Google.com. Chuyn hng website Tnh nng ny ging vic chuyn hng cuc gi, bn c th chnh sa file Hoste khi truy cp mt trang web, trnh duyt s dn n mt trang web khc. V d nh bn mun khi g vo thanh a ch tn min Bing.com, trnh duyt s hin ra trang Google.com, tuy nhin tnh nng ny c hu ch hay khng th cn ty thuc vo mi ngi. Trc tin bn s cn kim tra a ch IP ca trang Bing.com, bng Command Promp nu trn, sau khi bit IP ca trang web v d ca Bing l 131.253.13.32, nhp vo file Hosts dng lnh:131.253.13.32 Google.com. Tng t bn c th iu hng mt website khc n bt k website no bn mun. Ch nh tn min cho trang cu hnh router Nu bn thng xuyn phi truy cp vo trang cu hnh router, v mun to mt tn min d nh cho n, th bn c th thc hin tng t nh th thut to phm tt cho website trn. Ch khc mt iu l a ch IP website s c thay bng a ch Default Gateway, cng l a ch truy cp trang cu hnh router, v tn min bn c th t ty nh Gateway, Admin hay ch 1 ch ci nh X.

V d, cu lnh c th nh sau:192.168.1.1 Admin hoc 192.168.1.1 X. S dng phn mm qun l file Hosts

Vi mt phn mm qun l file Hosts nh HostsMan, bn c th d dng chnh sa v cp nht cc file Hosts trn trang hpHosts. hpHosts l trang web cung cp cc d liu file Hosts gip ngn chn cc trang pop-up, qung co v cc trang web c hi vi danh sch lin tc c cp nht. Bn c th la chn ghi ln file Hosts hin ti hoc st nhp c hai trnh b mt nhng thit lp t trc ca bn. Bn cng c th chnh sa file Hosts bng HostsMan vi giao din s dng rt n gin.

Bn c th ti phn mm HostsMan ti y. Khc phc li khng lu c file Hosts Nhiu bn khng s dng cch th cng chnh sa file Hosts nh hng dn phn u gii thiu, do c th b li khng th lu c cc thit lp trong file Hosts. khc phc li ny, bn cn vo th mc etc, ng dn C:\WINDOWS\system32\drivers\etc\, chut phi vo file hostsv chn Properties.

Trong tab General, b chn Read-only. Chuyn qua tab Security, trong danh sch Group of user name, chn Users, ri chn Edit. Trong khung Permissions chn Full Control.