I wonder if there is a way to use python to resolve a hostname that resolves only in ipv6 and/or for a hostname that resolves both in ipv4 and ipv6?
socket.gethostbyname()
and socket.gethostbyname_ex()
does not work for ipv6 resolution.
A dummy way to do that is to run actual linux host command and parse the results. Is there any better way to do that?
Thanks,
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…