host -a
ANSWER SECTIONのところにIPが表示される
% host -a stg.sample.com Trying "stg.sample.com" ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21689 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;stg.sample.com. IN ANY ;; ANSWER SECTION: stg.sample.com. 300 IN A 172.26.21.67 Received 80 bytes from 100.32.220.102#53 in 22 ms
dig
こちらもANSWER SECTIONの所にIPが表示される
% dig stg.sample.com ; <<>> DiG 9.10.6 <<>> stg.sample.com ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 22510 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 4000 ;; QUESTION SECTION: ;stg.sample.com. IN A ;; ANSWER SECTION: stg.sample.com. 103 IN A 172.26.213.67 ;; Query time: 18 msec ;; SERVER: 100.32.220.102#53(100.32.220.102) ;; WHEN: Mon Jun 21 11:33:06 JST 2021 ;; MSG SIZE rcvd: 91