Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
Note

host 는 DNS lookup 유틸리티로  nslookup 명령어와 동일한 역할을 수행합니다.

...

host 명령어 뒤에 조회하려는 도메인을 지정합니다.. 예로 아래는 google.com 의 IPv4(A), IPv6(AAAA) 와 MX(Mail Record)의 정보를 출력합니다

host 기본 사용법
Code Block
title
languagebashhost 기본 사용법
$ host google.com

google.com has address 216.58.220.110
google.com has IPv6 address 2404:6800:4004:800::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 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.

...

레코드 타입은 A, AAAA, MX, CNAME, NS, SOA, TXT, DNSKEY, AXFR 등 다양한 레코드를 지정할 수 있으며 대소문자를 가리지 않으므로 아래 명령은 모두 동일합니다.

host TXT type
Code Block
languagebash
titlehost TXT type
$ host -t txt google.com
$ host -t TxT google.com

A 레코드

다음 명령은 A 레코드만 조회합니다.

host A type
Code Block
languagebashtitlehost A type
$ host -t a google.com

google.com has address 216.58.220.110

...

다음 명령은 SPF 등록 여부를 확인하기 위해 TXT 레코드를 조회합니다.

host TXT type
Code Block
title
languagebashhost TXT type
$ host -t txt google.com

google.com descriptive text "docusign=05958488-4752-4ef2-95eb-aa7ba8a3bd0e"
google.com descriptive text "docusign=1b0a6754-49b1-4db5-8540-d2c12664b289"
google.com descriptive text "globalsign-smime-dv=CDYX+XFHUw2wml6/Gb8+59BsH31KzUr6c1l2BPvqKX8="
google.com descriptive text "v=spf1 include:_spf.google.com ~all"
google.com descriptive text "facebook-domain-verification=22rm551cu4k0ab0bxsw536tlds4h95"

CNAME 조회

CNAME 조회
Code Block
languagebash
titleCNAME 조회
$ host -t cname google.com

...

기본 설정된 DNS 가 아닌 외부의 DNS 를 지정해서 조회하려면 조회할 도메인 이름뒤에 사용할 도메인 서버를 넘겨주면 됩니다. 다음은 KT의 공개 DNS 인 168.126.63.1 을 사용하여 조회하는 예제입니다

외부 DNS 지정
Code Block
languagebashtitle외부 DNS 지정
$ host redhat.com 168.126.63.1

Using domain server:
Name: 168.126.63.1
Address: 168.126.63.1#53
Aliases:

redhat.com has address 209.132.183.105
redhat.com mail is handled by 10 us-smtp-inbound-2.mimecast.com.
redhat.com mail is handled by 10 us-smtp-inbound-1.mimecast.com.

...

사용할 DNS 를 넘겨주면 위와 같이 어떤 DNS 를 사용해서 조회하는지도 표시됩니다.

Ref