下記のコマンドで、macOSにてDNSのキャッシュクリアや、DNSサーバを指定してIPv4のDNSクエリを行う事ができます
コマンド
- DNSの問い合わせを行う(IPv4)
dig -4 my-domain.example.com
- DNSサーバーを指定してDNS問い合わせを行う(IPv4)
dig -4 @ns-xxx.awsdns-xx.com my-domain.example.com
- DNSキャッシュをクリアする(macOS 10.10.4以降の場合)
sudo killall -HUP mDNSResponder
マニュアル
digと、mDNSResponderのマニュアル抜粋です
NAME
dig - DNS lookup utility
SYNOPSIS
dig [@server] [-b address] [-c class] [-f filename] [-k filename] [-m] [-p port#]
[-q name] [-t type] [-v] [-x addr] [-y [hmac:]name:key] [-4] [-6] [name] [type]
[class] [queryopt...]
dig [-h]
dig [global-queryopt...] [query...]
SIMPLE USAGE
A typical invocation of dig looks like:
dig @server name type
where:
server
is the name or IP address of the name server to query. This can be an IPv4 address
in dotted-decimal notation or an IPv6 address in colon-delimited notation. When the
supplied server argument is a hostname, dig resolves that name before querying that
name server.
If no server argument is provided, dig consults /etc/resolv.conf; if an address is
found there, it queries the name server at that address. If either of the -4 or -6
options are in use, then only addresses for the corresponding transport will be
tried. If no usable addresses are found, dig will send the query to the local host.
The reply from the name server that responds is displayed.
name
is the name of the resource record that is to be looked up.
type
indicates what type of query is required -- ANY, A, MX, SIG, etc. type can be any
valid query type. If no type argument is supplied, dig will perform a lookup for an
A record.
OPTIONS
-4
Use IPv4 only.
NAME
mDNSResponder -- Multicast and Unicast DNS daemon
SYNOPSIS
mDNSResponder
DESCRIPTION
mDNSResponder(システムによってはmdnsdとも呼ばれます)は、マルチキャストDNSおよびDNSサービスディスカバリーを実装するために起動時に呼び出されるデーモンです。
Mac OS X 10.6 (Snow Leopard) の場合、mDNSResponderはシステム全体のユニキャストDNSリゾルバでもあります。
```
こちらもおススメ