Hier werden die Unterschiede zwischen zwei Versionen gezeigt.
| lpi2:dns [2018/10/08 13:10] | lpi2:dns [2024/08/08 04:11] (aktuell) | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| + | ====== Namensauflösung ====== | ||
| + | ===== Rechnernamen einstellen ===== | ||
| + | ==== Temporär ==== | ||
| + | hostname <name> | ||
| + | ==== Dauerhaft ==== | ||
| + | hostnamectl set-hostname <name> | ||
| + | oder | ||
| + | <file txt /etc/hostname> | ||
| + | notebook25 | ||
| + | </file> | ||
| + | (( FQDN wird aus ''hostname'' und ''/etc/hosts'' gebildet )) | ||
| + | |||
| + | ===== DNS Client mit files & dns ===== | ||
| + | Wie und in welcher Reihenfolge sollen Netzwerknamen aufgelöst werden?  | ||
| + | Mit Hilfe der Datei ''/etc/hosts'' und/oder eines Nameservers ? | ||
| + | |||
| + | <file txt /etc/nsswitch.conf >hosts:  files dns</file> | ||
| + | |||
| + | ''files'' - Netzwerknamen statisch einstellen: | ||
| + | |||
| + | <file txt /etc/hosts> | ||
| + | 192.168.1.225  notebook25.linuxhotel.de notebook25 | ||
| + | 127.0.0.1  localhost.localdomain localhost | ||
| + | ::1 localhost6.localdomain6 localhost6 | ||
| + | </file> | ||
| + | |||
| + | ''dns'' - DNS Client Einstellungen: | ||
| + | |||
| + | <file txt /etc/resolv.conf> | ||
| + | search linuxhotel.de | ||
| + | nameserver 192.168.1.5 | ||
| + | nameserver 192.168.1.4 | ||
| + | </file> | ||
| + | |||
| + | ==== Testen ==== | ||
| + | Lokale Namensauflösung testen: | ||
| + | getent hosts $(hostname) | ||
| + | getent hosts $(hostname -f) | ||
| + | getent hosts 192.168.1.225 | ||
| + | |||
| + | getent ahosts $(hostname) | ||
| + | getent ahosts $(hostname -f) | ||
| + | getent ahosts 192.168.1.225 | ||
| + | |||
| + | Konfigurierten DNS Server abfragen: | ||
| + | host www.linuxhotel.de | ||
| + | |||
| + | Anderen DNS Server abfragen: | ||
| + | host www.linuxhotel.de 9.9.9.9 | ||
| + | ===== FQDN mit files, dns & myhostname ===== | ||
| + | FQDN ohne statische IP-Adresse in ''/etc/hosts'' | ||
| + | |||
| + | Paket: | ||
| + | * ''libnss-myhostname'' (Debian) | ||
| + | |||
| + | <file txt /etc/nsswitch.conf >hosts:  files myhostname dns</file> | ||
| + | |||
| + | Netzwerknamen fest einstellen: | ||
| + | |||
| + | <file txt /etc/hosts> | ||
| + | 127.0.1.1  notebook25.linuxhotel.de notebook25 | ||
| + | 127.0.0.1  localhost.localdomain localhost | ||
| + | ::1 localhost6.localdomain6 localhost6 | ||
| + | </file> | ||
| + | |||