Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Port number in A record in zone file

284 views
Skip to first unread message

Aleksander Kurczyk

unread,
Nov 17, 2011, 8:46:45 AM11/17/11
to bind-...@lists.isc.org
Hello,
Yesterday I asked here how can I run multiple named processes on different ports in one OS. Now I have some troubles with that. How can I specify the port number in zone file A record?

My config and zone files:

095160160157:/var/named root# cat srv1/named.conf
options {
directory "/var/named/srv1";
version "olo-dns-server-1.0";
allow-transfer { 127.0.0.1; };
allow-recursion { 127.0.0.1; };
listen-on 127.0.0.1 port 2001;
};

zone "srv1.local" IN {
type master;
file "srv1.local.master";
};

zone "srv2.local" IN {
type slave;
file "srv2.local.slave";
};

zone "srv3.local" IN {
type slave;
file "srv3.local.slave";
};

zone "." IN {
type hint;
file "named.ca";
};

zone "localhost" IN {
type master;
file "localhost.zone";
allow-update { none; };
};

zone "0.0.127.in-addr.arpa" IN {
type master;
file "named.local";
allow-update { none; };
};


095160160157:/var/named root# cat srv1/srv1.local.master
$TTL 1d
$ORIGIN srv1.local.
@ IN SOA ns1 hostmaster 2011111700 12h 5m 3w 2h
IN NS ns1
IN NS ns2
IN NS ns3
ns1 IN A 127.0.0.1 <<-- port 2001
ns2 IN A 127.0.0.1 <<-- port 2002
ns3 IN A 127.0.0.1 <<-- port 2003
11 IN A 192.168.1.11
12 IN A 192.168.1.12
13 IN A 192.168.1.13


095160160157:/var/named root# cat srv2/named.conf
options {
directory "/var/named/srv2";
version "olo-dns-server-1.0";
allow-transfer { 127.0.0.1; };
allow-recursion { 127.0.0.1; };
listen-on 127.0.0.1 port 2002;
};

zone "srv1.local" IN {
type slave;
file "srv1.local.slave";
};

zone "srv2.local" IN {
type master;
file "srv2.local.master";
};

zone "srv3.local" IN {
type slave;
file "srv3.local.slave";
};

zone "." IN {
type hint;
file "named.ca";
};

zone "localhost" IN {
type master;
file "localhost.zone";
allow-update { none; };
};

zone "0.0.127.in-addr.arpa" IN {
type master;
file "named.local";
allow-update { none; };
};


095160160157:/var/named root# cat srv2/srv2.local.master
$TTL 1d
$ORIGIN srv2.local.
@ IN SOA ns1 hostmaster 2011111700 12h 5m 3w 2h
IN NS ns1
IN NS ns2
IN NS ns3
ns1 IN A 127.0.0.1 <<-- port 2001
ns2 IN A 127.0.0.1 <<-- port 2002
ns3 IN A 127.0.0.1 <<-- port 2003
11 IN A 192.168.1.11
12 IN A 192.168.1.12
13 IN A 192.168.1.13


095160160157:/var/named root# cat srv3/named.conf
options {
directory "/var/named/srv3";
version "olo-dns-server-1.0";
allow-transfer { 127.0.0.1; };
allow-recursion { 127.0.0.1; };
listen-on 127.0.0.1 port 2003;
};

zone "srv1.local" IN {
type slave;
file "srv1.local.slave";
};

zone "srv2.local" IN {
type slave;
file "srv2.local.slave";
};

zone "srv3.local" IN {
type master;
file "srv3.local.master";
};

zone "." IN {
type hint;
file "named.ca";
};

zone "localhost" IN {
type master;
file "localhost.zone";
allow-update { none; };
};

zone "0.0.127.in-addr.arpa" IN {
type master;
file "named.local";
allow-update { none; };
};


095160160157:/var/named root# cat srv3/srv3.local.master
$TTL 1d
$ORIGIN srv3.local.
@ IN SOA ns1 hostmaster 2011111700 12h 5m 3w 2h
IN NS ns1
IN NS ns2
IN NS ns3
ns1 IN A 127.0.0.1 <<-- port 2001
ns2 IN A 127.0.0.1 <<-- port 2002
ns3 IN A 127.0.0.1 <<-- port 2003
11 IN A 192.168.1.11
12 IN A 192.168.1.12
13 IN A 192.168.1.13


--
Pozdrawiam,
Aleksander Kurczyk

Rick Dicaire

unread,
Nov 17, 2011, 8:51:51 AM11/17/11
to Aleksander Kurczyk, bind-...@lists.isc.org
On Thu, Nov 17, 2011 at 8:46 AM, Aleksander Kurczyk
<aleksand...@o2.pl> wrote:
> Hello,
> Yesterday I asked here how can I run multiple named processes on different ports in one OS. Now I have some troubles with that. How can I specify the port number in zone file A record?

You can't.

Why would you run a dns server on a non standard port? There's no way
for clients to query via non standard ports.

--
aRDy Music and Rick Dicaire present:
http://www.ardynet.com
http://www.ardynet.com:9000/ardymusic.ogg.m3u

Torsten Segner

unread,
Nov 17, 2011, 8:53:34 AM11/17/11
to Aleksander Kurczyk, bind-...@lists.isc.org
Am Thu, 17 Nov 2011 14:46:45 +0100
schrieb Aleksander Kurczyk <aleksand...@o2.pl>:

> Hello,
> Yesterday I asked here how can I run multiple named processes on different ports in one OS. Now I have some troubles with that. How can I specify the port number in zone file A record?
>


There is a simple answer: You can't.

An A record consists of only an IPv4 address.



Ciao
Torsten

Aleksander Kurczyk

unread,
Nov 17, 2011, 9:41:54 AM11/17/11
to bind-...@lists.isc.org
Dnia 17 listopada 2011 14:51 Rick Dicaire <kri...@gmail.com> napisał(a):
> You can't.

If not, it is possible to map traffic from 127.0.0.11:53, 127.0.0.12:53 and 127.0.0.13:53 to 127.0.0.1:2001, 127.0.0.1:2002 and 127.0.0.1:2003 or to setup new loopback interfaces for 127.0.0.11, 127.0.0.12 and 127.0.0.13 on Mac OS X or somehow do that?

> Why would you run a dns server on a non standard port? There's no way
> for clients to query via non standard ports.

I would like to make a experimental configuration simulating a few BIND servers on one PC (PowerMac G4 400 Mhz :) ), without virtual machines.

--
Pozdrawiam,
Aleksander Kurczyk

Matthew Seaman

unread,
Nov 17, 2011, 9:52:58 AM11/17/11
to bind-...@lists.isc.org
On 17/11/2011 14:41, Aleksander Kurczyk wrote:
> If not, it is possible to map traffic from 127.0.0.11:53,
> 127.0.0.12:53 and 127.0.0.13:53 to 127.0.0.1:2001, 127.0.0.1:2002 and
> 127.0.0.1:2003 or to setup new loopback interfaces for 127.0.0.11,
> 127.0.0.12 and 127.0.0.13 on Mac OS X or somehow do that?

If you're going to create all those alias IPs on the loopback, why not
just run a named on each of them directly? No need to worry about port
translation then.

Setting up aliases is easy enough:

seedling:~:% sudo ifconfig lo0 inet 127.0.0.2 alias
Password:
seedling:~:% ifconfig lo0
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
inet 127.0.0.1 netmask 0xff000000
inet 127.0.0.2 netmask 0xff000000

(deleting one is just: sudo ifconfig lo0 inet 127.0.0.2 -alias)

Cheers,

Matthew

--
Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard
Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
JID: mat...@infracaninophile.co.uk Kent, CT11 9PW

signature.asc

Bill Owens

unread,
Nov 17, 2011, 9:54:36 AM11/17/11
to Aleksander Kurczyk, bind-...@lists.isc.org
On Thu, Nov 17, 2011 at 03:41:54PM +0100, Aleksander Kurczyk wrote:
> > Why would you run a dns server on a non standard port? There's no way
> > for clients to query via non standard ports.
>
> I would like to make a experimental configuration simulating a few BIND servers on one PC (PowerMac G4 400 Mhz :) ), without virtual machines.

So would I, but the only way I know of to do this is through some form of VM. I've seen a very nice setup using KVM and that's what I'm playing with so far, though it's a spare time effort and I haven't made a lot of progress. . .

Bill.

Brian Wilson

unread,
Nov 17, 2011, 10:10:35 AM11/17/11
to bind-...@lists.isc.org
> _______________________________________________
> Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe from this list
>
> bind-users mailing list
> bind-...@lists.isc.org
> https://lists.isc.org/mailman/listinfo/bind-users
If you happen to have the IP addresses, why not just use the standard
port on multiple IPs on one machine, then use the 'listen-on' for each
instance to point at the individual IPs? If you don't have the IP
addresses available to do that, then I think you're back to VMs.

cheers,
Brian

--
-----------------------------------------------------------------------------------
Brian Wilson, Solaris SE, UW-Madison DoIT
Room 3114 CS&S 608-263-8047
brian.wilson(a)doit.wisc.edu
'I try to save a life a day. Usually it's my own.' - John Crichton
-----------------------------------------------------------------------------------

Aleksander Kurczyk

unread,
Nov 17, 2011, 10:15:04 AM11/17/11
to bind-...@lists.isc.org
It works :)
Thanks very much


Dnia 17 listopada 2011 15:52 Matthew Seaman <m.se...@infracaninophile.co.uk> napisał(a):

> On 17/11/2011 14:41, Aleksander Kurczyk wrote:
> > If not, it is possible to map traffic from 127.0.0.11:53,
> > 127.0.0.12:53 and 127.0.0.13:53 to 127.0.0.1:2001, 127.0.0.1:2002 and
> > 127.0.0.1:2003 or to setup new loopback interfaces for 127.0.0.11,
> > 127.0.0.12 and 127.0.0.13 on Mac OS X or somehow do that?
>
> If you're going to create all those alias IPs on the loopback, why not
> just run a named on each of them directly? No need to worry about port
> translation then.
>
> Setting up aliases is easy enough:
>
> seedling:~:% sudo ifconfig lo0 inet 127.0.0.2 alias
> Password:
> seedling:~:% ifconfig lo0
> lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
> inet6 ::1 prefixlen 128
> inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
> inet 127.0.0.1 netmask 0xff000000
> inet 127.0.0.2 netmask 0xff000000
>
> (deleting one is just: sudo ifconfig lo0 inet 127.0.0.2 -alias)
>
> Cheers,
>
> Matthew
>
>

--
Pozdrawiam,
Aleksander Kurczyk

John Wobus

unread,
Nov 17, 2011, 10:20:45 AM11/17/11
to bind-users
On Nov 17, 2011, at 8:51 AM, Rick Dicaire wrote:
> On Thu, Nov 17, 2011 at 8:46 AM, Aleksander Kurczyk
> <aleksand...@o2.pl> wrote:
>> Hello,
>> Yesterday I asked here how can I run multiple named processes on
>> different ports in one OS. Now I have some troubles with that. How
>> can I specify the port number in zone file A record?
>
> You can't.


nameservice SRV record? :)

John

P.S. I'm fully aware that no DNS record is of any use if
clients don't look it up.

Evan Hunt

unread,
Nov 17, 2011, 10:43:46 AM11/17/11
to Aleksander Kurczyk, bind-...@lists.isc.org
> > Why would you run a dns server on a non standard port? There's no way
> > for clients to query via non standard ports.
>
> I would like to make a experimental configuration simulating a few BIND
> servers on one PC (PowerMac G4 400 Mhz :) ), without virtual machines.

Take a look at how the BIND 9 automatic tests work: they're the
source tree under bind9/bin/tests/system. There's a script in that
directory called "ifconfig.sh" which sets up alias addresses on the
loopback interface (10.53.0.1, 10.53.0.2, etc), and then the tests
can have servers running on those aliases talking to each other.
For example the "dnssec" test has a root server, TLD server, SLD
server, and several resolvers (some of them misconfigured) to
test DNSSEC validation from the root.

--
Evan Hunt -- ea...@isc.org
Internet Systems Consortium, Inc.

Mark Andrews

unread,
Nov 17, 2011, 3:40:50 PM11/17/11
to Aleksander Kurczyk, bind-...@isc.org

In message <5e1a7573.3227017...@o2.pl>, =?UTF-8?Q?Aleksander_Kurczyk?= writes:
> Hello,
> Yesterday I asked here how can I run multiple named processes on different ports in one OS. Now I have some troubles with t
> hat. How can I specify the port number in zone file A record?

You can't.

It has been suggested to you by multiple people to use virtual interfaces
or virtual machines to do your testing.
> --
> Pozdrawiam,
> Aleksander Kurczyk
> _______________________________________________
> Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe from this list
>
> bind-users mailing list
> bind-...@lists.isc.org
> https://lists.isc.org/mailman/listinfo/bind-users
--
Mark Andrews, ISC
1 Seymour St., Dundas Valley, NSW 2117, Australia
PHONE: +61 2 9871 4742 INTERNET: ma...@isc.org
0 new messages