Cisco Support Community
Showing results for 
Search instead for 
Did you mean: 

Tclsh implementation of host

osted By:


Posted Date:

Jul 11, 2008


Network Management




Cisco-Style BSD


Tclsh script to do DNS lookups on IOS.

Script Modified Date:

Jul 11, 2008

Cisco IOS Version tested:


Cisco Products Tested:


Environment Variables used:

Rating Count:


Average Rating:


File Size:

3 KB

Script Info URL:

This tclsh script implements the UNIX host command on IOS.  The  host.tcl script is currently limited to IPv4 A and PTR lookups only.  It  can also dynamically determine the DNS server by looking at the running  config.  However, if you want to specify a DNS server to use, that is  also possible.  To use the script, do the following:    tclsh host.tcl  HOST [DNS SERVER]    Where HOST is the hostname or IP address to lookup,  and DNS SERVER is an optional DNS server name or IP address.  For  example:    Router#tclsh flash:host.tcl has  address    Router#tclsh flash:host.tcl domain name pointer

Version history
Revision #:
1 of 1
Last update:
‎10-28-2011 04:01 PM
Updated by:
Labels (1)
New Member

I could use some help trying to figure out why this utility doesn't output anything on either of the Cisco devices I try it from.  If I execute this utility from say, a linux host, and it executes properly and returns a valid lookup.

I run it from a 2621 and only get back an empty line as a result.  I run it from a 2811 and only get back the string 'ERROR' followed by an empty line.

any thoughts as to how to debug further to determine what in IOS is preventing this from working?


Cisco Employee

There is a newer version of this script at that might help.  Else, what version of code are you running on these devices?  Do you use command authorization?