Dns – Resolving Ipv4 adress from DNS using the Ipv6 adress of a host

dnsipv6

I need to make a DNS query to one of my clients using IPv6 to resolve the IPv4 adress for the machine, how would I go about doing that. I know i can just use the hostname to resolve both IPv4 & IPv6 for the machine, but the assignment is to use the IPv6 address to resolve the IPv4 adress for one of the clients of the network.

The client is a Windows 7 machine and the DNS-server is debian Using Bind9.

I tried adding the IPv4 address to the PTR record of the IPv6 adress, but that resulted in only getting either the IPv4 adress or the hostname of the client when doing nslookup (half of the time it would show the hostname, half of the time it would show the Ipv4 address).

What I am essentially looking to do is that when I write (nslookup 2001:db8:acad:1::10), the DNS-Server should respond with both the hostname & the Ipv4 address.

Best Answer

You can't realiably do that. If you do a reverse lookup for an IPv6 address and get the hostname, that name might not have any IPv4 attached to it, or it might be another machine's address entirely. PTR records must point to names, not IP addresses.

You could add TXT records that have the IPv4 records, but they'd have to be manually edited, so there isn't really a point in using DNS for this.

In any case you need to do two queries and you can't just send a simple query to determine this.

I assume this might be an XY problem, so if you explain why you need this it might help.

Related Question