When you're working on a website and want to be able to access the site before the DNS has changed, there's a relatively easy way to do it. First, open the Terminal application (search for it with Spotlight). Don't worry if you're not an expert with Terminal — this is easy to do. In Terminal, type
sudo nano /etc/hosts and press enter. Since this is a protected system file, you'll need to enter your password to be allowed to edit the file.
The host file is a simple text file with one website on each line. The first few lines are special entries that should not be changed, so move the cursor down to a blank line. Enter the IP address of the website you want to forward (or if the website should forward to your own computer, enter
127.0.0.1), then tab over (or type a few spaces), then type the name of the website.
When you're done making changes, press control-x to quit. The text editor will ask if you want to save, so press the letter Y for yes, then press enter to save with the original file name. That's it! Now, when you load the website in your browser, it will be loaded from the IP address you've entered into the hosts file. No need to reboot or even restart the web browser.
Ikiwa unataka kuanzisha tovuti yako na unataka kuipata kabla ya DNS kubadilika, kuna njia rahisi ya kufanya hivyo. Kwanza, kufungua maombi Terminal (kutafuta kwa Spotlight). Usiwe na wasiwasi kama wewe si mtaalam na Terminal <unk> hii ni rahisi kufanya. Katika terminal, type sudo nanoetc na weka. Kwa kuwa hii ni faili ya mfumo kulindwa, unahitaji kuingia nenosiri lako kuruhusiwa kuhariri faili. faili mwenyeji ni faili ya maandishi rahisi na tovuti moja juu ya kila mstari. Mistari michache ya kwanza ni entries maalum ambayo haipaswi kubadilishwa, hivyo hoja cursor chini kwa mstari tupu. Kuingiza IP ya tovuti ambayo unataka kuhamisha (au ikiwa tovuti inapaswa kuhamisha kwa kompyuta yako mwenyewe, ingiza 127.0.0.1), kisha weka tab juu (au weka nafasi chache), kisha weka jina la tovuti. Wakati wewe ni kufanyika kufanya mabadiliko, bonyeza kudhibiti-x kuacha. Mhariri wa maandishi atakuuliza ikiwa unataka kuhifadhi, kwa hivyo bonyeza herufi Y kwa ndiyo, kisha bonyeza kuingia kuhifadhi na jina la faili ya awali. Hiyo ni hivyo! Sasa, wakati wewe kupakia tovuti katika kivinjari yako, itakuwa kupakiwa kutoka anwani ya IP umefanya kuingia katika faili ya majeshi. Hakuna haja ya kuanzisha upya au hata kuanzisha upya kivinjari cha wavuti.