I needed the current IP-addresses of the gmail MX server (don’t ask the details; but it has to do with the brain-dead TP-LINK ER5120 configuration possibilities).
This is the command I finally used:
dig @8.8.8.8 +short MX gmail.com | sed "s/^[0-9]* //g" | sed "s/.$//" | xargs -I {} dig @8.8.8.8 +short {} | uniq | sort
Basically it’s a three stage sequence which had to work on OS X as well as Linux using a bash shell:
- Use the Google DNS servers (either 8.8.8.8 or 8.8.4.4)
- Get the FQDNs of MX records of gmail.com which are the mail servers for GMail.
- Translate these in IPv4 addresses
- Filter into a distinct list (just in case entries are duplicate: they aren’t yet, but might be)
The basics of the above are about using dig to get short (or terse) answers with as little (but still to the point) information as possible.
Read the rest of this entry »
Like this:
Like Loading...