In der hosts Datei kann man die im lokalen Netzwerk oder auch im Internet liegenden Rechner und Server eintragen.
Diese werden dann in den lokalen DNS Cache geladen und nicht über den DNS-Server abgefragt. Es gibt auch unter Windows die Möglichkeit, eine Blacklist zu erstellen.
Unter Windows liegt die hosts Datei in " C:\Windows\System32\drivers\etc "
Und unter Linux liegt sie in "/etc". Beide Dateien sehen sich sehr ähnlich.
So sieht die Standard hosts Datei unter Windows aus.
# Copyright (c) 1993-2009 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 # localhost name resolution is handled within DNS itself. # 127.0.0.1 localhost # ::1 localhost
So sieht die hosts Datei unter Linux aus. (Hier schon mit Einträgen und Aliasen).
linux:~ # cat /etc/hosts # Syntax: # # IP-Address Full-Qualified-Hostname Short-Hostname # 127.0.0.1 localhost 217.89.70.36 linux36.amov.de linux36 walter 217.89.70.37 linux37.amov.de linux37 willi 217.89.70.38 linux38.amov.de linux38 manuela 217.89.70.39 linux39.amov.de linux39 peter 217.89.70.40 linux40.amov.de linux40 kai 217.89.70.38 mail.amov.de mail
Ein Beispiel:
IP Adresse | Hostname | Full Qualified Domain Name (FQDN) | Kommentar |
192.168.2.20 | dc-1 | dc1.company.local | #Name des Domaincontrollers |
2a00:1450:400c:c0a::6c | dc-2 | dc2.company.local | #Name des Domaincontrollers 2 |
Ein Beispiel:
IP Adresse | Hostname | Full Qualified Domain Name (FQDN) | Kommentar |
0.0.0.0 | dc-1 | dc1.company.local | #Name des Domaincontrollers |