Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get IPv4 and IPv6 with one command

Tags:

dig

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:

dig hostname A 

And this command will give me the IPv6 address:

dig hostname AAAA 

How can I get both addresses, IPv4 and IPv6, with just one command?

like image 728
user3645265 Avatar asked May 16 '14 15:05

user3645265


People also ask

How do I find IPv4 and IPv6?

By using I-P. show, you can check whether you are: On an IPv4 supported device here: https://v4.i-p.show. On an IPv6 supported device here: https://v6.i-p.show.

Can I have both IPv4 and IPv6 at the same time?

IPv4 and IPv6 must coexist for some number of years, and their coexistence must be transparent to end users. If an IPv4-to-IPv6 transition is successful, end users should not even notice it. A dual-stack device is a device with network interfaces that can originate and understand both IPv4 and IPv6 packets.

How do I find IPv4 and IPv6 in Linux?

To check whether a CS Linux server is running IPv4 or IPv6, use the command ifconfig -a and look at the IP address or addresses in the output. These will be IPv4 dotted-decimal addresses, IPv6 hexadecimal addresses, or both.

How do I find my IPv6 address using CMD?

Type “ipconfig/all” on the blinking cursor then press [Enter]. NOTE: You will find the IPv6 Address network details under the Ethernet adapter Local Area Connection section.


1 Answers

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

like image 67
user3166580 Avatar answered Sep 19 '22 04:09

user3166580