-3

For debug purposes I need to ensure that all hostnames resolve to ipv4 addresses.

So I want to leave in /etc/resolv.conf only one dns server that will serve ipv4 only addresses. But i can't find such one.

update: Final goal - redirect all traffic to proxy chain. Some parts of this chain can work only with v4 addresses so I want to ensure that on first node hostname resolves to v4 address

deathnik
  • 1
  • 2
  • 5
    If that's what you want, then why don't you just query for A records explicitly? – Michael Hampton Aug 26 '15 at 07:30
  • Final goal - redirect all traffic to proxy chain. Some parts of this chain can work only with v4 addresses so I want to ensure that on first node hostname resolves to v4 address. – deathnik Aug 26 '15 at 08:09
  • What? Proxy chain? And, why are you doing resolution at that stage at all? Your architecture is very strange and my impression is that you should reconsider it to reduce complexity. – Falcon Momot Aug 26 '15 at 10:22
  • Currently on vacation in a hotel with a b0rked IPv6 config, only sites that resolve to IPv4 working, wish this question had an answer.. – GregC Aug 05 '23 at 03:09

1 Answers1

7

A DNS server will only serve you what you ask for. If you only want IPv4 answers then it's up to the client to only ask for that. For debugging the dig tool is probably what you are looking for.

If you want to look for A (IPv4 address) records for e.g. www.google.com then you can do:

dig www.google.com A

And the IPv6 equivalent:

dig www.google.com AAAA

If you want to query a specific server you can specify that with:

dig @8.8.8.8 www.google.com A

There are many more options but this should be enough to debug what you are asking for.

Sander Steffann
  • 7,712
  • 19
  • 29