Hier werden die Unterschiede zwischen zwei Versionen gezeigt.
|
lpi1:dns [2019/06/18 12:40] |
lpi1:dns [2026/02/22 08:05] (aktuell) |
||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| + | ====== Namensauflösung ====== | ||
| + | ===== Eigenen Rechnernamen einstellen ===== | ||
| + | ==== Temporär ==== | ||
| + | hostname <name> | ||
| + | |||
| + | ==== Dauerhaft ==== | ||
| + | Debian, CentOS (ab 7), SLES (ab 12): | ||
| + | <file txt /etc/hostname> | ||
| + | notebook13 | ||
| + | </file> | ||
| + | (( FQDN wird aus ''hostname'' und ''/etc/hosts'' bzw. ''/etc/resolv.conf'' gebildet )) | ||
| + | |||
| + | ==== Mit systemd ==== | ||
| + | |||
| + | hostnamectl set-hostname notebook13 | ||
| + | |||
| + | ===== DNS Client ===== | ||
| + | Wie und in welcher Reihenfolge (( | ||
| + | man nsswitch.conf | ||
| + | )) sollen Netzwerknamen aufgelöst werden? | ||
| + | Mit Hilfe der Datei ''/etc/hosts'' und/oder eines Nameservers ? | ||
| + | |||
| + | <file txt /etc/nsswitch.conf> | ||
| + | hosts: files dns | ||
| + | </file> | ||
| + | |||
| + | Netzwerknamen fest einstellen: | ||
| + | |||
| + | <file txt /etc/hosts> | ||
| + | 127.0.0.1 localhost.localdomain localhost | ||
| + | ::1 localhost6.localdomain6 localhost6 | ||
| + | 192.168.1.225 notebook25 | ||
| + | </file> | ||
| + | |||
| + | DNS Client Einstellungen: | ||
| + | <file txt /etc/resolv.conf> | ||
| + | search linuxhotel.de | ||
| + | nameserver 192.168.1.7 | ||
| + | nameserver 192.168.1.6 | ||
| + | </file> | ||
| + | |||
| + | ++++ mehr Einstellungsmöglichkeiten | | ||
| + | {{:admin_grundlagen:resolveconf.png?400|}} | ||
| + | ++++ | ||
| + | ===== Testen ===== | ||
| + | Clientseitig Namensauflösung testen: | ||
| + | getent ahosts $(hostname) | ||
| + | getent ahosts $(hostname -f) | ||
| + | getent ahosts 192.168.1.219 | ||
| + | |||
| + | ++++ RFC 6761 | | ||
| + | RFC [[RFC>6761]] | ||
| + | getent ahosts -s dns whatever.localhost | ||
| + | ++++ | ||
| + | Nameserver abfragen: | ||
| + | host <name> <dns-server> | ||
| + | |||
| + | |||
| + | ====== systemd-resolved ====== | ||
| + | [[systemd-resolved]] | ||