On Fri, Apr 09, 2010 at 07:43:39PM +1000, Nathan Rickerby wrote:
> 
> > When you add port to nameserver option in /etc/resolv.conf like
> > 'nameserver 192.168.23.21:5300', then dig(1) and host(1) gets timeout.
> > Also when port is :53
> 
> The syntax is
>   nameserver [192.168.23.21]:5300
> 
> The resolv.conf(5) man page says, "A non-standard port may be specified
> using [host]:port syntax.". The square brackets are required. It's normal
> to use them when specifying a port for an IPv6 address.
> 
> It is potentially confusing though, given that square brackets usually
> indicate something optional, see the relayd.conf(5) and ftp(1) man pages
> for example.  I've included a documentation patch below that tries to
> clarify it.
> 

thanks for the diff - i've just committed a slightly tweaked version.

> Would there be any interest in a patch that modifies the resolv.conf
> parsing code to accept IPv4:port style address specification without
> the square brackets?
> 

i'll let others step in here, if they so wish.
jmc

> Regards
> Nathan
> 
> Index: share/man/man5/resolv.conf.5
> ===================================================================
> RCS file: /cvs/src/share/man/man5/resolv.conf.5,v
> retrieving revision 1.33
> diff -u share/man/man5/resolv.conf.5
> --- share/man/man5/resolv.conf.5      20 Nov 2009 14:43:43 -0000      1.33
> +++ share/man/man5/resolv.conf.5      9 Apr 2010 09:42:09 -0000
> @@ -112,6 +112,12 @@
>  A non-standard port may be specified using
>  .Ar [host]:port
>  syntax.
> +When a non-standard port is specified the host 
> +address must be enclosed in square brackets, e.g.:
> +.Bd -literal -offset indent
> +nameserver [130.155.160.1]:5353
> +nameserver [2001:db8::a00:20ff:fea7:ccea]:5353
> +.Ed
>  .Pp
>  Up to
>  .Dv MAXNS

Reply via email to