diff options
-rwxr-xr-x | rex | 9 | ||||
-rw-r--r-- | rex.man8 | 13 |
2 files changed, 18 insertions, 4 deletions
@@ -403,6 +403,11 @@ namespace eval ::pmres { set dnscache($mode,$arg) $res return $res } + + proc setname {mode arg val} { + variable dnscache + set dnscache($mode,$arg) $val + } } proc hostname {arg} { @@ -2486,6 +2491,10 @@ namespace eval ::config { lappend hostlist {*}$args } + proc hostname {ip name} { + ::pmres::setname -ip $ip $name + } + proc ifmode {args} { switch -- $::config(mode) {*}$args } @@ -1,5 +1,5 @@ .\" This file is part of rex - a remote execution utility -*- nroff -*- -.\" Copyright (C) 2012-2016 Sergey Poznyakoff +.\" Copyright (C) 2012-2017 Sergey Poznyakoff .\" .\" Rex is free software; you can redistribute it and/or modify .\" it under the terms of the GNU General Public License as published by @@ -13,7 +13,7 @@ .\" .\" You should have received a copy of the GNU General Public License .\" along with Rex. If not, see <http://www.gnu.org/licenses/>. -.TH REX 8 "September 24, 2016" "REX" "Rex User Reference" +.TH REX 8 "October 31, 2017" "REX" "Rex User Reference" .ds ET /etc .SH NAME rex \- remote execution utility @@ -181,6 +181,11 @@ that purpose: \fBhost\fR \fIHOSTNAME\fR [\fIHOSTNAME\fR...] Adds the listed hostnames to the list of hosts. .TP +\fBhostname\fR \fIIP\fR \fINAME\fR +Registers \fINAME\fR in DNS cache as a hostname for the IPv4 +address \fIIP\fR. This is useful if \fIIP\fR has no PTR record, or its +PTR record is deemed unsutable for some reason. +.TP \fBifmode\fR \fB{\fR \fImode\fR \fIbody\fR [\fImode\fR \fIbody\fR...] \fB}\fR Matches the current mode agains each of \fImode\fR arguments. As soon as the match is found, the corresponding \fBbody\fR is evaluated. @@ -1080,7 +1085,7 @@ Interaction with poses considerable problems because it spits out enormous amounts of escape sequences for colorization and other purposes, which makes it next to impossible to write an efficient regular expression for ->recognizing command line prompts. To make matters even worse, it +recognizing command line prompts. To make matters even worse, it ignores any changes made by \fBstty\fR. .PP An ad-hoc way of coping with hosts running \fBzsh\fR is provided by @@ -1225,7 +1230,7 @@ Sergey Poznyakoff .SH "BUG REPORTS" Report bugs to <gray+rex@gnu.org.ua>. .SH COPYRIGHT -Copyright \(co 2012\-2016 Sergey Poznyakoff +Copyright \(co 2012\-2017 Sergey Poznyakoff .br .na License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> |