¿Qué hay de host
?
El comando host
es muy similar a dig
, excepto que es mucho más simple y no tiene la información muy técnica (si no la necesita). Entonces, por ejemplo, una búsqueda de host
tendría el siguiente aspecto:
$ host apple.stackexchange.com
apple.stackexchange.com has address 151.101.129.69
apple.stackexchange.com has address 151.101.193.69
apple.stackexchange.com has address 151.101.65.69
apple.stackexchange.com has address 151.101.1.69
También puede especificar qué servidor DNS desea usar agregándolo al comando:
$ host apple.stackexchange.com 8.8.8.8
Using domain server:
Name: 8.8.8.8
Address: 8.8.8.8#53
Aliases:
apple.stackexchange.com has address 151.101.193.69
apple.stackexchange.com has address 151.101.129.69
apple.stackexchange.com has address 151.101.1.69
apple.stackexchange.com has address 151.101.65.69
Y si es absolutamente necesario, puedes agregar -a
para obtener el mismo resultado que un comando dig
:
$ host -a apple.stackexchange.com 8.8.8.8
Trying "apple.stackexchange.com"
Using domain server:
Name: 8.8.8.8
Address: 8.8.8.8#53
Aliases:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 26262
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;apple.stackexchange.com. IN ANY
;; ANSWER SECTION:
apple.stackexchange.com. 299 IN A 151.101.129.69
apple.stackexchange.com. 299 IN A 151.101.65.69
apple.stackexchange.com. 299 IN A 151.101.193.69
apple.stackexchange.com. 299 IN A 151.101.1.69
Received 105 bytes from 8.8.8.8#53 in 39 ms