Bash - Get IP Address from domain name

# Single IP dig +short www.codepad.co | awk '{ print ; exit }' : ' 192.95.22.55 ' # Full output dig www.codepad.co : ' ; <<>> DiG 9.8.3-P1 <<>> www.codepad.co ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 43762 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;www.codepad.co. IN A ;; ANSWER SECTION: www.codepad.co. 3600 IN A 192.95.22.55 ;; Query time: 105 msec ;; SERVER: 75.75.75.75#53(75.75.75.75) ;; WHEN: Wed Jul 20 21:53:06 2016 ;; MSG SIZE rcvd: 48 '

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.