I am trying to get list of all hostnames from my DNS server by command:
host -l example-domain.com mydns.com
However one machine has invalid DNS name, because there are two hyphens in row and I get error:
host: 'exa--mple.example-domain.com' is not a legal IDNA2008 name.....
In this case executing of this command is interrupted and I don't get complete list. Is there any way how to skip this error, and get complete list? Or maybe some other command? I have also tried dig command, but there is same problem:
dig @mydns.com example-domain.com axfr
Something like "try/catch" would be fine, but I think it doesn't exist in bash. I have also tried export IDN_DISABLE=1 according to manual of command host. Unfortunately, it doesn't help me, still same error. I am using current version of debian.