dig treats -4/-6/-m after -q argument as an option but not a domain name
Summary
According to man dig
, the argument after -q
should always be treated as domain name:
-q name
The domain name to query. This is useful to distinguish the name
from other arguments.
However, I noticed that if name
starts with -4
, -6
or -m
, it will be treated as arguments, like this:
$ dig -q -64
dig: only one of -4 and -6 allowed
While other hyphen-starting name works well (I manually add A record for -test
on our DNS server):
$ dig +short -q -test
1.2.3.4
(Domain name starting with hyphen is not legal in RFC1034. But most DNS server/client softwares indeed support it.)
BIND version used
$ dig -v
DiG 9.13.3