hostexpand
[options] host-expression [...]
Expand the host-expressionn into new-line separated list hostnames. Check each host in DNS and return only hosts that can be resolved. Short hostnames can be expanded to FQDNs according to the DNS search path in the local DNS resolver.
-
--version: Show version
-
--nrformat=NRFORMAT: Set number format, default is
%02i
-
--outputformat=OUTPUTFORMAT: Set the output format. Can be one of
shortname
,fqdn
, orip
. Default isshortname
.
The following host-expressions are recognized, different pattern styles can be mixed freely:
-
Patterns: Expressions like
foo*
are searched in DNS, starting from 1 and going up till no more hosts are found. The NRFORMAT sets the length of the number. In this examplefoo01
,foo02
... would be searched. -
Number Ranges: Expressions like
foo[5..10]
are expanded tofoo05
,foo06
,foo07
,foo07
,foo09
,foo10
. Expressions likefoo[5:10]
are expanded tofoo05
,foo06
,foo07
,foo07
,foo09
. -
Alternatives: Expressions like
{foo|bar}
are expanded tofoo
,bar
. -
File Includes: Expressions including a
/
are interpreted as a file to read, the file should contain hostnames one per line. # comments and empty lines are ignored.
- Build status:
- Homepage: http://github.com/yadt/hostexpand
It is considered good practice to install all packages available via pip & easy_install in a virtual environment so that your development dependencies are isolated from the system-wide dependencies.
-
create a virtual environment for building
virtualenv ve
-
activate the virtual environment
source ve/bin/activate
-
install the hostexpand from PyPi
pip install hostexpand
Licensed under the GNU General Public License (GPL), see http://www.gnu.org/licenses/gpl.txt for full license text.