DNS Aramalarını Sorgulamak için Yararlı 'ana bilgisayar' Komut Örnekleri


Host komutu, alan adlarını IP adreslerine (veya tam tersi) çeviren DNS aramaları gerçekleştirmek için kullanılan minimal ve kullanımı kolay bir CLI yardımcı programıdır. Ayrıca NS ve MX gibi çeşitli DNS kayıt türlerini listelemek ve doğrulamak, ISP DNS sunucusunu ve İnternet bağlantısını test etmek ve doğrulamak, kayıtları spam ve kara listeye almak, DNS sunucusu sorunlarını tespit etmek ve gidermek için de kullanılabilir.

Bu yazıda, Linux'ta DNS aramaları gerçekleştirmek için host komutunun nasıl kullanılacağını birkaç faydalı örnekle öğreneceğiz. Önceki makalelerde, DNS sunucularını test etmek ve sorun gidermek ve ayrıca belirli DNS kaynak kayıtlarını (RR) sorgulamak için en çok kullanılan 8 Nslookup komutunu göstermiştik.

Ayrıca DNS bilgilerini sorgulamak için 10 Linux Dig (Domain Information Groper) komutunu da anlattık, daha çok Nslookup aracına benzer şekilde çalışır. Ana bilgisayar yardımcı programı da benzer şekilde çalışır ve tüm ana Linux dağıtımlarında olmasa da çoğunda önceden yüklenmiş olarak gelir.

Bununla birlikte, aşağıdaki 14 ana bilgisayar komutuna bakalım.

Etki Alanı IP Adresini Bulun

Bu, çalıştırabileceğiniz en basit ana makine komutudur; ilişkili IP adreslerini almak için google.com gibi bir alan adı sağlamanız yeterlidir.

$ host google.com

google.com has address 216.58.201.46
google.com has address 216.58.201.46
google.com has address 216.58.201.46
google.com has IPv6 address 2a00:1450:4009:80b::200e
google.com mail is handled by 20 alt1.aspmx.l.google.com.
google.com mail is handled by 30 alt2.aspmx.l.google.com.
google.com mail is handled by 10 aspmx.l.google.com.
google.com mail is handled by 40 alt3.aspmx.l.google.com.
google.com mail is handled by 50 alt4.aspmx.l.google.com.

Alan Adı Sunucularını Bulun

Alan adı sunucularını bulmak için -t seçeneğini kullanın.

$ host -t ns google.com

google.com name server ns1.google.com.
google.com name server ns2.google.com.
google.com name server ns3.google.com.
google.com name server ns4.google.com.

Alan Adı CNAME Kaydını Bul

CNAME alan adını bulmak için çalıştırın.

$ host -t cname mail.google.com

mail.google.com is an alias for googlemail.l.google.com.

Etki Alanı MX Kaydını Bul

Bir alan adına ait MX kayıtlarını bulmak için.

$ host -n -t mx google.com

ogle.com mail is handled by 50 alt4.aspmx.l.google.com.
google.com mail is handled by 10 aspmx.l.google.com.
google.com mail is handled by 40 alt3.aspmx.l.google.com.
google.com mail is handled by 30 alt2.aspmx.l.google.com.
google.com mail is handled by 20 alt1.aspmx.l.google.com.

Alan Adı TXT Kaydını Bul

Bir alan adına ait TXT kayıtlarını bulmak için.

$ host -t txt google.com

google.com descriptive text "v=spf1 include:_spf.google.com ~all"

Alan Adı SOA Kaydını Bul

Ana bilgisayar, -C bayrağıyla, o bölge için listelenen tüm yetkili ad sunucularından, belirtilen bölge için SOA kayıtlarını görüntülemeyi deneyebilirsiniz.

$ host -C google.com

Nameserver 216.239.38.10:
	google.com has SOA record ns1.google.com. dns-admin.google.com. 156142728 900 900 1800 60
Nameserver 216.239.32.10:
	google.com has SOA record ns3.google.com. dns-admin.google.com. 156142728 900 900 1800 60
Nameserver 216.239.34.10:
	google.com has SOA record ns4.google.com. dns-admin.google.com. 156142728 900 900 1800 60
Nameserver 216.239.36.10:
	google.com has SOA record ns2.google.com. dns-admin.google.com. 156142728 900 900 1800 60

Özel Ad Sunucusunu Sorgula

Belirli alan adı sunucusunu sorgulamak için.

$ host google.com ns4.google.com

Using domain server:
Name: ns4.google.com
Address: 216.239.38.10#53
Aliases: 

google.com has address 172.217.19.46
google.com has address 172.217.19.46
google.com has address 172.217.19.46
google.com has IPv6 address 2a00:1450:4005:808::200e
google.com mail is handled by 30 alt2.aspmx.l.google.com.
google.com mail is handled by 20 alt1.aspmx.l.google.com.
google.com mail is handled by 50 alt4.aspmx.l.google.com.
google.com mail is handled by 10 aspmx.l.google.com.
google.com mail is handled by 40 alt3.aspmx.l.google.com.

Etki Alanı Kayıtlarının ve Bölgelerin Tüm Bilgilerini Bulun

HERHANGİ türden bir sorgu yapmak için -v seçeneğinin ayarlanmasına eşdeğer olan -a (tümü) seçeneğini kullanın.

$ host -a google.com

Trying "google.com"
;; ->>HEADER<

Alan Adı TTL Bilgisini Alın

Alan adı TTL bilgilerini öğrenmek için.

$ host -v -t a google.com

Trying "google.com"
;; ->>HEADER<

IPv4 veya IPv6'yı kullanın

-4 veya -6 seçeneği, ana bilgisayarı sırasıyla yalnızca IPv4 veya yalnızca IPV6 sorgu aktarımını kullanmaya zorlar.

host -4 google.com
OR
host -6 google.com

Yinelemeli Olmayan Sorgular Gerçekleştirin

-r seçeneği yinelemeli olmayan sorgular gerçekleştirir; bu seçeneğin ayarlanmasının, ana bilgisayarın sorgudaki biti olan RD'yi (özyineleme arzu edilir) temizlediğini unutmayın.

$ host -rR 5 google.com

google.com has address 216.58.201.46
google.com has address 216.58.201.46
google.com has address 216.58.201.46
google.com has IPv6 address 2a00:1450:4009:80b::200e
google.com mail is handled by 30 alt2.aspmx.l.google.com.
google.com mail is handled by 40 alt3.aspmx.l.google.com.
google.com mail is handled by 50 alt4.aspmx.l.google.com.
google.com mail is handled by 20 alt1.aspmx.l.google.com.
google.com mail is handled by 10 aspmx.l.google.com.

Arama için UDP Yeniden Denemelerini Ayarlama

Varsayılan olarak UDP deneme sayısı 1'dir, bunu değiştirmek için -R bayrağını kullanın.

$ host -R 5 google.com

google.com has address 216.58.201.46
google.com has address 216.58.201.46
google.com has address 216.58.201.46
google.com has IPv6 address 2a00:1450:4009:80b::200e
google.com mail is handled by 30 alt2.aspmx.l.google.com.
google.com mail is handled by 40 alt3.aspmx.l.google.com.
google.com mail is handled by 50 alt4.aspmx.l.google.com.
google.com mail is handled by 20 alt1.aspmx.l.google.com.
google.com mail is handled by 10 aspmx.l.google.com.

Yanıt için Sorgu Süresini Ayarla

-W anahtarını kullanarak, ana bilgisayara saniye cinsinden belirtilen süre boyunca yanıt beklemesi talimatını verebilirsiniz ve eğer -w bayrağı kullanılırsa, ana bilgisayarın sonsuza kadar beklemesini sağlar bir cevap için:

$ host -T -W 10 google.com

google.com has address 216.58.201.46
google.com has address 216.58.201.46
google.com has address 216.58.201.46
google.com has IPv6 address 2a00:1450:4009:80b::200e
google.com mail is handled by 10 aspmx.l.google.com.
google.com mail is handled by 40 alt3.aspmx.l.google.com.
google.com mail is handled by 30 alt2.aspmx.l.google.com.
google.com mail is handled by 20 alt1.aspmx.l.google.com.
google.com mail is handled by 50 alt4.aspmx.l.google.com.

Bu kadar! Bu yazımızda Linux'ta host komutunun nasıl kullanılacağını birkaç faydalı örnekle öğrendik. Bu kılavuzla ilgili düşüncelerinizi bizimle paylaşmak için aşağıdaki geri bildirim formunu kullanın.