Thursday, July 11, 2013

What is the Hosts file?

שלום חברים,

האם אי פעם שאלתם את עצמכם מה הוא קובץ Hosts?
תנו לי לנסות לשפוך קצת אור על הנושא,

התשובה קצרה:
קובץ Hosts הוא כמו פנקס כתובות. בעת הקלדת כתובת כמו www.Google.co.il בדפדפן שלך, קובץ Hosts "מתייעץ" כדי לראות אם יש לך את כתובת ה-IP, או "מספר טלפון" עבור אתר זה.
אם קיים המספר (טלפון/ IP), המחשב "ייצור קשר " עם האתר והאתר ייפתח. אם לא, המחשב יתשאל את ספק השירות באינטרנט (ISP) כדי לקבל את מספר הטלפון לפני שהוא יתקשר עם  האתר. לרוב, אין לנו כתובות ב" ספר הכתובות, " בגלל שאנחנו לא כותבים כתובות בקובץ. לכן, רוב זמן המחשב יבקש את כתובת ה-IP מספק האינטרנט כדי למצוא את האתרים.
במקרה ובחרנו לשים שמות שרתים בקובץ Hosts עם כתובת ה-IP של המחשב שלנו, המחשב שלנו לעולם לא יהיה מסוגל ליצור קשר עם האתר. הוא ינסה, אבל פשוט יקרא לעצמו ויקבל "צליל תפוס" כמו שאנחנו מקבלים בטלפון. בסופו של דבר המחשב יוותר והאתר לא ייטען.

התשובה ארוכה:
קובץ " Hosts" ב-Windows משמש לקישור host names עם כתובות IP. Host names הם כתובות כמו www.Google.co.il שאתם כותבים בכל יום. כתובות IP הן מספרים שאומרים את אותו דבר כמו בדוגמא לעיל www.Google.co.il.

המחשבים משתמשים במספרים כדי למצוא את האתרים, אבל אנחנו במילים כמו www.Google.co.il כך נחסך מאיתנו לזכור את המחרוזות הארוכות של מספרים, כאשר אנחנו רוצים לבקר באתר.
ישנם סדרה של צעדים בעת חיפוש כתובות IP, כדי לנווט אותנו ל- host names האלה. הצעד הראשון הוא את קובץ hosts במחשב המקומי שלך. קובץ Hosts במחשב שלך "מספר" מה הוא שם שקשור למספרים כדי שהמחשב יוכל ללכת למצוא אותו. אם כתובת ה-IP נמצאת בקובץ Hosts, המחשב יפסיק לחפש ויכנס לאתר זה, אבל אם לא המחשב ישאל מחשב DNS (שרת שם תחום) ע"מ לקבל מידע.
אנחנו יכולים לשים את שמות וכתובות בקובץ Hosts כך המחשב לא יצטרך לשאול את שרת ה-DNS כדי לתרגם את שם הדומיין למספר ה-IP. פעולה זו מגבירה את המהירויות בגישה לאתר המארח כי הוא לא צריך לתשאל מערכות אחרות לתרגום הכתובת. כשנקליד כתובת אינטרנט כמו www.Google.co.il, המארח מתרגם את כתובת האינטרנט לכתובת ה-IP לפני שניתן לגשת לאתר. אם אתם שמים את מארח כ-Google ומגדירים ה-IP בקובץ Hosts שלך, הטעינה תהיה קצת יותר מהירה, כי המחשב לא צריך לשאול ולתרגם איפה לחפש את Google.
למחשבים יש כתובת עצמאית שלהם – היא ידועה ככתובת "localhost", עם כתובת ה-IP של 127.0.0.1 שמשמש כדי להתייחס לעצמו. אם אתה מקשר את שם המארח של מחשב אחר עם כתובת ה-IP שלך localhost, כל ניסיונות גישתו יובילו בחזרה אליך. אנחנו מגדירים שכתובת ה-IP של האתר שאנחנו רוצים לחסום היא הכתובת שלנו. באופן זה, המחשב שלנו לעולם לא יעזוב וימשיך לחפש את האתר שאנחנו חוסמים – מה שגורם לאתר לא להופיע משום שהמחשב חושב שמצא את האתר יציג אותו כבר.

כדי לערוך את קובץ hosts שלך ב-Windows, בצע את הפעולות הבאות:
1. פתח את סייר Windows במערכת שלך
2. נווט אל C: \ WINDOWS \ system32 \ drivers \ etc
3. מצא קובץ בשם "Hosts" (אין לו סיומת קובץ), ולחץ עליו פעמיים.
4. Windows ישאל אותך אם ברצונך לפתוח אותו ושכדי לפתוח אותו עם, בחר לפתוח אותו עם פנקס רשימות (notepad.exe).
5. ברגע שהקובץ פתוח, אתה יכול להוסיף את השורות הדרושות. אם צוות התמיכה שלנו מבקש ממך לשנות את קובץ hosts שלך, הם יספקו לך את הקו המדויק כדי להיכנס. הקו יהיה במתכונת של:
o 1.1.1.1 somedomain.com
o 1.1.1.1 somedomain.com ftp.somedomain.com www.somedomain.com

6. שמור וסגור את הקובץ.

בהצלחה !
רון נס.
============================================================================================================================================================================================================================================================



Hello Friends,
Have you ever asked yourself what is the Host file?
Let me try to explain it for you,
The Short Answer:
The Hosts file is like an address book. When you type an address like www.Google.co.il into your browser, the Hosts file is consulted to see if you have the IP address, or "Phone number," for that site.
If you do, then your computer will "call it" and the site will open. If not, your computer will ask your internet service provider (ISP's) computer for the phone number before it can "call" that site. Most of the time, you do not have addresses in your "address book," because you have not put any there. Therefore, most of the time your computer asks for the IP address from your ISP to find sites.
In case you put ad server names into your Hosts file with your own computer's IP address, your computer will never be able to contact the ad server. It will try to, but it will be simply calling itself and get a "busy signal" of sorts. Your computer will then give up calling the ad server and no ads will be loaded.

The Long Answer:
The "Hosts" file in Windows is used to associate host names with IP addresses. Host names are the www.Google.co.il addresses that you see every day. IP addresses are numbers that mean the same thing as the example above www.Google.co.il.

 Computers use numbers to actually find the sites, but we have words like www.Google.co.il so humans do not need to remember the long strings of numbers when they want to visit a site.
A series of steps are used when searching for IP addresses that go with these host names. The first step, and the one that concerns us here, is the hosts file on your local computer. The Hosts file tells your computer what the name is in numbers so the computer can go find it. If the IP address is found in your Hosts file, the computer will stop looking and go to that site, but if it is not it will ask a DNS computer (domain name server) for the information.
We can put names and addresses into the Hosts file so your computer does not have to ask a DNS server to translate the domain name into an IP number. This speeds up access to the host site you want to see because your computer no longer has to query other systems on the Internet for the address translation. When you type in a web address like www.Google.co.il, the host name portion of the web address is translated into an IP address before the site is accessed. If you put Google host and IP settings into your Hosts file, it would load a little quicker because your computer doesn't have to ask another to translate where to look for Google
Computers have a host address of their own - it is known as the "localhost" address, with an IP address of 127.0.0.1 which it uses to refer to itself. If you associate another computer's host name with your localhost IP address, you have effectively blocked that host since all attempts to access it will lead back to you. We will tell our computer that the IP address of the site we want to block is our own address. That way, our computer will not ever leave and go looking for the site we are blocking - which keeps that site from appearing because the computer thinks it has found the site and displayed it already.

To edit your hosts file on Windows, follow these steps:
  1. Open Windows Explorer on your system
  2. Navigate to c:\windows\system32\drivers\etc
  3. Find the file named "hosts" (it has no file extension), and double click it.
  4. Windows will ask you if you want to open it and what to open it with, choose to open it with Notepad (notepad.exe).
  5. Once the file is open, you can add the necessary lines.  If our support team is asking you to modify your hosts file, they will provide you the exact line to enter.  The line will be in the format of:
    • 1.1.1.1 somedomain.com
    • 1.1.1.1 somedomain.com ftp.somedomain.com www.somedomain.com
    • Where "1.1.1.1" equals the ip address you need to point to and "somedomain.com" is the hostname you need to map/resolve the IP to.
  6. Save and Close the File.
 Good Luck :)


Ron Ness.

No comments:

Post a Comment