Digamos que estou tentando pesquisar os IPs mail.yahoo.com
, gmail.com
e mail.google.com
Se eu executar:
dig @8.8.8.8 +nocomments +noquestion \
+noauthority +noadditional +nostats +nocmd \
gmail.com mail.yahoo.com mail.google.com
Eu recebo:
gmail.com. 299 IN A 173.194.123.21
gmail.com. 299 IN A 173.194.123.22
mail.yahoo.com. 0 IN CNAME login.yahoo.com.
login.yahoo.com. 0 IN CNAME ats.login.lgg1.b.yahoo.com.
ats.login.lgg1.b.yahoo.com. 0 IN CNAME ats.member.g02.yahoodns.net.
ats.member.g02.yahoodns.net. 0 IN CNAME any-ats.member.a02.yahoodns.net.
any-ats.member.a02.yahoodns.net. 17 IN A 98.139.21.169
mail.google.com. 0 IN CNAME googlemail.l.google.com.
googlemail.l.google.com. 243 IN A 173.194.123.21
googlemail.l.google.com. 243 IN A 173.194.123.22
Posso garantir que, se eu vir um registro CNAME
, o registro A
correspondente a ele não aparecerá antes de um CNAME
correspondente a outra máquina ou um registro A
de outro nome de host?
Por exemplo, deixe-me concentrar em mail.yahoo.com
(eu só quero que o IP ou IPs mail.yahoo.com
resolva):
Esta é a saída:
mail.yahoo.com. 0 IN CNAME login.yahoo.com.
login.yahoo.com. 0 IN CNAME ats.login.lgg1.b.yahoo.com.
ats.login.lgg1.b.yahoo.com. 0 IN CNAME ats.member.g02.yahoodns.net.
ats.member.g02.yahoodns.net. 0 IN CNAME any-ats.member.a02.yahoodns.net.
any-ats.member.a02.yahoodns.net. 17 IN A 98.139.21.169
O nome do host que estou procurando ( mail.yahoo.com
) é a primeira coluna da primeira entrada. Então, há um monte de CNAMES
que eu realmente não me importo e, em seguida, um A
com o IP real (que eu me importo).
Existe a possibilidade de obter os registros CNAMES
ou A
fora de ordem? Algo como:
ats.login.lgg1.b.yahoo.com. 0 IN CNAME ats.member.g02.yahoodns.net. #(!)BAD
ats.member.g02.yahoodns.net. 0 IN CNAME any-ats.member.a02.yahoodns.net. #(!)BAD
mail.yahoo.com. 0 IN CNAME login.yahoo.com.
login.yahoo.com. 0 IN CNAME ats.login.lgg1.b.yahoo.com.
any-ats.member.a02.yahoodns.net. 17 IN A 98.139.21.169
Ou ainda pior (o registro real A
no topo):
any-ats.member.a02.yahoodns.net. 17 IN A 98.139.21.169
mail.yahoo.com. 0 IN CNAME login.yahoo.com.
login.yahoo.com. 0 IN CNAME ats.login.lgg1.b.yahoo.com.
ats.login.lgg1.b.yahoo.com. 0 IN CNAME ats.member.g02.yahoodns.net.
ats.member.g02.yahoodns.net. 0 IN CNAME any-ats.member.a02.yahoodns.net.
Ou o pior dos piores (em uma execução de dig
de resolução múltipla, como a mostrada na parte superior do post):
ats.member.g02.yahoodns.net. 0 IN CNAME any-ats.member.a02.yahoodns.net.
any-ats.member.a02.yahoodns.net. 17 IN A 98.139.21.169
mail.google.com. 0 IN CNAME googlemail.l.google.com. # This one I want
gmail.com. 299 IN A 173.194.123.21 # This one I want
gmail.com. 299 IN A 173.194.123.22 # This one I want
mail.yahoo.com. 0 IN CNAME login.yahoo.com. # This one I want
login.yahoo.com. 0 IN CNAME ats.login.lgg1.b.yahoo.com.
ats.login.lgg1.b.yahoo.com. 0 IN CNAME ats.member.g02.yahoodns.net.
googlemail.l.google.com. 243 IN A 173.194.123.21
googlemail.l.google.com. 243 IN A 173.194.123.22
Obrigado antecipadamente.