هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.
ماذا يفعل
hostname prints the current host name. Options show the FQDN, the DNS domain or all IP addresses.
Setting a name with hostname NAME lasts only until reboot. To set it for good on RHEL, use hostnamectl set-hostname NAME (writes /etc/hostname).
طريقة الكتابة
hostname [OPTION]
hostname [-b] [-F FILE] [NAME]الخيارات 12
الأكثر استخدامًا
لا يوجد شيء يطابق هذا الفلتر.
أمثلة 10
$ مستخدم عادي# بصلاحية root (أو مع sudo)
1Show the host name
hostname server1.example.comRHEL often uses the full name as host name.
2Short name and FQDN
hostname -s; hostname -f server1 server1.example.com-f needs /etc/hosts or DNS to know the full name.
3All IP addresses
hostname -I 192.168.122.10 fe80::5054:ff:fe12:3456Quick way to find the IP of a fresh VM.
4Domain part
hostname -d example.comSame as
dnsdomainname.5Set a name until reboot
hostname test1For a quick test only.
6Set the name for good
hostnamectl set-hostname server1.example.comWrites /etc/hostname (the RHCSA way).
7Use the name in a prompt or file name
Each server makes a different file name.
8Check the name for certificates
hostname -f; getent hosts $(hostname -f)The FQDN must resolve to the server IP before you request a TLS certificate.
9Find wrong FQDN settings
hostname -f hostname: Name or service not knownAdd the name to /etc/hosts or DNS.
10Show the domain of NIS
hostname -yOnly for old NIS setups.
لا يوجد شيء يطابق هذا الفلتر.
الملفات
/etc/hostname- The static host name.
/etc/hosts- Local name to address list.
رموز الخروج
0 | Done. |
1 | Error. |