hostname(1) change

Kent Ibbetson bsd at
Sun Jan 4 19:38:05 PST 2004

Hi Matt n all,

Matthew Dillon probed the keyboard and on Sun, Jan 04, 2004 at 06:55:01PM -0800 produced:
> :Thanks for the suggestion Emiel, attached is a new patchset (based on clean
> :source), I haven't done much IPV6 work, but it seems to work ok, you can now
> :do the following and get the same result;
> :
> :hostname
> :hostname -r 3ffe:b00:c18:1::10
> :hostname -r
>     I like it!  How would you like to add one more feature... the ability
>     to have hostname pull the IP address out of a network interface and then
>     reverse resolve it to set the host name, e.g.
>     hostname -i fxp0
> 						-Matt

Thanks, actually, that was my original intention, hence using -r (for reverse)
and leaving -i for interface.  I just knew whacking out the code for reverse
would be quicker (that, and I had a need for it).  I'll add some interface
probing code and resubmit.  I assume using sysctl(3) is the correct method
for grabbing the interface details (I'm using ifconfig(8) as a reference) and
using the first IP address found on the given interface would be appropriate?


Kent Ibbetson
bsd at xxxxxxxxxx

More information about the Submit mailing list