Skip to content

Instantly share code, notes, and snippets.

@rooterkyberian
Created January 12, 2020 20:08
Show Gist options
  • Save rooterkyberian/d9d7e5194398c9e504f4a4614f302f1f to your computer and use it in GitHub Desktop.
Save rooterkyberian/d9d7e5194398c9e504f4a4614f302f1f to your computer and use it in GitHub Desktop.
DNS test
#!/bin/bash
# Test which DNS server is problematic (local dnsmasq, your SOHO router or is maybe whole Internet connection at fault if wellknown DNS fails as well
REMOTE_DNS=`nmcli dev show|perl -n -e '/IP4.DNS.*\s+([\d.]+)/ && print $1`
WELLKNOWN_DNS=1.1.1.1
for server in localhost $REMOTE_DNS $WELLKNOWN_DNS;
do
dig gist.github.com @${server} &;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment