I have to use dig
to get the IP for a domain. I can run dig
and I get output like the following (using www.google.no for an example):
1
2 ; <<>> DiG 9.10.3 <<>> www.google.no A
3 ;; global options: +cmd
4 ;; Got answer:
5 ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 2264
6 ;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 1
7
8 ;; OPT PSEUDOSECTION:
9 ; EDNS: version: 0, flags:; udp: 1280
10 ;; QUESTION SECTION:
11 ;www.google.no. IN A
12
13 ;; ANSWER SECTION:
14 www.google.no. 129 IN A 74.125.232.111
15 www.google.no. 129 IN A 74.125.232.119
16 www.google.no. 129 IN A 74.125.232.127
17 www.google.no. 129 IN A 74.125.232.120
18
19 ;; Query time: 0 msec
20 ;; SERVER: 10.69.201.10#53(10.69.201.10)
21 ;; WHEN: Tue Jan 19 13:37:41 Vest-Europa (normaltid) 2016
22 ;; MSG SIZE rcvd: 106
How can I obtain just the IP addresses from lines 14-17 of the above output?