الفلاتر
طريقة البحث
  • الكلمات العادية تجد الأسماء والنصوص والأمثلة.
  • "كلمتان" تجد العبارة بالضبط.
  • --name أو -x تجد خيارًا.
  • #كلمة تبحث داخل الأوامر فقط.
  • @grep تجد الدروس والمعامل التي تستخدم grep.
  • الفلاتر: cat:network · in:labs · level:rhcsa · ch:8 · root:yes. ضع ! قبل كلمة لاستبعادها. OR بين الكلمات تعني إحداها.
  • ↑ ↓ للتنقل · Enter للفتح · Esc للإغلاق · / للبحث

host

Simple DNS lookups with short, readable output.

المستوى
لينكس اليومي
المجموعة
الشبكة
يحتاج root
لا
الحزمة
bind-utils

هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.

ماذا يفعل

host NAME prints the addresses and mail servers of a name in plain sentences. host IP does a reverse lookup. Use -t for other record types. For details use dig.

طريقة الكتابة

host [OPTION]... NAME [SERVER]

الخيارات 20

الأكثر استخدامًا

-t TYPE
Record type: A, AAAA, MX, NS, TXT, SOA, PTR, SRV, CNAME, ANY …
-a
All: verbose output with type ANY.
-A
Almost all: like -a without RRSIG, NSEC, NSEC3.
-v, -d
Verbose (like dig output).
-C
Compare the SOA records of all authoritative servers.
-l
List a zone with a zone transfer (AXFR).
-r
No recursion.
-s
Do not try the next server after a SERVFAIL.
-T
Use TCP.
-U
Use UDP (default).
-4
Use IPv4 for the transport.
-6
Use IPv6 for the transport.
-c CLASS
Query class (IN default).
-N NDOTS
Dots needed before the name is tried as is.
-p PORT
Use another port.
-R NUMBER
Number of UDP retries.
-W WAIT
Wait this many seconds for an answer.
-w
Wait forever.
-m FLAG
Memory debugging (record, trace, usage).
-V
Show the version.

أمثلة 10

$ مستخدم عادي# بصلاحية root (أو مع sudo)

  1. 1Look up a name

    host www.redhat.com
    www.redhat.com is an alias for www.redhat.com.edgekey.net.
    www.redhat.com.edgekey.net is an alias for e3396.dscx.akamaiedge.net.
    e3396.dscx.akamaiedge.net has address 23.40.100.73

    Plain text answer.

  2. 2Reverse lookup

    host 192.168.122.20
    20.122.168.192.in-addr.arpa domain name pointer server2.example.com.

    PTR record of the IP.

  3. 3Mail servers

    host -t MX s0sta.com

    Check after you move mail.

  4. 4Ask another DNS server

    host server2.example.com 192.168.122.1

    The last argument is the server.

  5. 5Text records

    host -t TXT s0sta.com

    SPF and site verification records.

  6. 6Compare the SOA of all name servers

    host -C s0sta.com

    Different serials = a secondary did not get the update.

  7. 7All records, verbose

    host -a s0sta.com

    Many servers block ANY today.

  8. 8Test a zone transfer (security, own zones)

    host -l example.com ns1.example.com

    Should be refused for the public; open AXFR leaks all names.

  9. 9IPv6 address

    host -t AAAA www.google.com

    Check that IPv6 records exist.

  10. 10Quick check in a script

    host -W 2 server2 >/dev/null && echo "DNS ok"

    Exit code 0 when the name was found.

رموز الخروج

0Found.
1Not found or error.

الدليل الكامل

هذه الصفحة تشرح الأمر بكلمات بسيطة. الدليل الأصلي فيه كل التفاصيل.

في الطرفية: man host