Jump to content

Workflow to display the current DNS


Recommended Posts

Wondering if it's possible to build a workflow to display the current DNS settings, either as feedback into Alfred or a Notification Center output. I'm not looking to change the DNS (I can do that manually, if I have to). But I use Unblock-US.com to view region-specific content, and I want to be able to quickly check that the DNS settings haven't reverted back.

 

Thoughts?

Link to comment

So this is what I get out of Terminal, when I enter the "cat /etc/resolv.conf" command.

 

#
# Mac OS X Notice
#
# This file is not used by the host name and address resolution
# or the DNS query routing mechanisms used by most processes on
# this Mac OS X system.
#
# This file is automatically generated.
#
domain phub.net.cable.rogers.com
nameserver 208.122.23.22
nameserver 208.122.23.23

 

What I have no idea how to do is to get Alfred to pull the "208.122.23.22" and "208.122.23.23" out and post them into Notification Center or back into Alfred.  :wacko:

Link to comment

So this is what I get out of Terminal, when I enter the "cat /etc/resolv.conf" command.

 

 

What I have no idea how to do is to get Alfred to pull the "208.122.23.22" and "208.122.23.23" out and post them into Notification Center or back into Alfred.  :wacko:

 

servers=( `cat /etc/resolv.conf | grep nameserver | cut -d " " -f 2` )

echo "${servers[0]}"
8.8.8.8

echo "${servers[1]}"
8.8.4.4

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...