Get IPv4 and IPv6 with one command

前端 未结 2 1108
一整个雨季
一整个雨季 2021-01-30 16:22

I would like to know if it\'s possible to get IPv4 and IPv6 addresses with just one invocation of dig?

For example, this gives the IPv4 address:



        
2条回答
  •  一生所求
    2021-01-30 16:59

    It may be that this has been added to dig since the question was asked, but for completeness this can be accomplished through the following query:

    dig hostname A hostname AAAA +short
    

    Source: http://linux.die.net/man/1/dig -- under the 'Multiple Queries' section

提交回复
热议问题