Determine Your Upstream DNS Resolver

The following one-liner Bash will output your upstream DNS resolver. You will need to install the whois package for this to work. Akamai is deprecating and succeeding it with so if you have a choice of what to count on in the future, I’d go with those.

whois $(dig +short) | grep -i 'organization:'

DNS=$(dig +short TXT | awk '{print $2}');whois $(sed -e 's/^"//' -e 's/"$//' <<<"$DNS") | grep -i 'organization'

DNS=$(dig +short TXT | awk '{print $2}');whois $( echo $DNS|tr -d '"' ) | grep -i 'organization'

And here is my output:

sysinfoio:~$ DNS=$(dig +short TXT | awk '{print $2}');whois $(sed -e 's/^"//' -e 's/"$//' <<<"$DNS") | grep -i 'Organization'
Organization: Cloudflare, Inc. (CLOUD14)
sysinfoio:~$ DNS=$(dig +short TXT | awk '{print $2}');whois $( echo $DNS|tr -d '"' ) | grep -i 'Organization'
Organization: Cloudflare, Inc. (CLOUD14)
sysinfoio:~$ whois $(dig +short) | grep -i 'organization:'
Organization: Cloudflare, Inc. (CLOUD14)

Disqus Comments Loading...

Recent Posts

Bittorrent IP Blocklists

In addition to using a VPN service, as an extra precaution I've been using the blocklist feature of my bittorrent… Read More

October 26, 2019 3:31 pm

FreeNAS Error Creating Pool

command '('gpart', 'create', '-s', 'gpt', '/dev/da8')' returned non-zero exit status 1. If you get this error while trying to create… Read More

June 7, 2019 3:44 pm

Change Grub Default Boot Entry on Linux Mint

I'm dual booting Windows and Linux Mint on my laptop. The grub default is to boot into Linux Mint, however… Read More

April 23, 2019 7:45 pm

How to Reset Secure Channel On Active Directory Domain Controller

When you're a little too careless about virtualizing your domain controllers, cloning, migrating, backing up and restoring, returning from vacation… Read More

April 21, 2019 8:14 am

Run Systemd Script Before System Shutdown

I tried to retain the NGINX FastCGI cache and have it persist across system reboots instead of being ephemeral by… Read More

April 20, 2019 10:14 am

Learn Systemctl Usage to Manage Systemd Service in Linux

Systemd is new service manager for Linux. It's a replacement for all previous init systems (SysV/SysVinit & Ubuntu's Upstart) and… Read More

April 20, 2019 7:55 am