0

I use dig +short @127.0.0.1 -p 5336 www.google.com to get the IP address that is being resolved to. I am wondering if there is a similar bash command to just get the ttl value?

gogofan
  • 533
  • 1
  • 10
  • 20

1 Answers1

0

Using grep and awk:

# dig www.google.com | grep '^[[:alnum:]]'
www.google.com.         34      IN      A       31.13.73.17
# dig www.google.com | grep '^[[:alnum:]]' | awk '{ print $2 }'
21
#