FedFsDnsSrv0.9

From Linux NFS

(Difference between revisions)
Jump to: navigation, search
(Introduction)
(Adding a DNS SRV to an existing DNS)
Line 33: Line 33:
You can add additional SRV records which refer to other NFS servers each exporting a copy of the domain root.
You can add additional SRV records which refer to other NFS servers each exporting a copy of the domain root.
 +
 +
=== Backwards compatibility ===
 +
 +
The DNS SRV record for advertising FedFS domain root servers is specified in RFC 6641.  Previous versions of this document specified a slightly different and incompatible format.  If your domain must support legacy FedFS clients (for example, fedfs-utils-0.8) you may want to provide both the RFC 6641 compliant record and the legacy record.
 +
 +
In the zone file in the example above, add an additional record:
 +
 +
_nfs4._domainroot._tcp          IN SRV          0 0 2049 server.example.net.
== Setting up a forwarding DNS ==
== Setting up a forwarding DNS ==

Revision as of 15:54, 17 October 2012

Contents

Project: fedfs-utils

[ Project Home | News | Downloads | Docs | Mailing Lists | Source Control | Issues ]


Introduction

To permit clients to find the top-level directory of a FedFS domain's name space, the NFS server that exports that directory is advertised via a DNS SRV record. Typically a FedFS-enabled NFS client mounts this directory at /nfs4/<fedfs-domain-name> .

This article describes two easy ways to configure a DNS SRV record that allows NFS clients to find the root of a FedFS domain namespace.

Public FedFS domain
If you have administrative access to your domain name service, you can add a DNS SRV record which advertises your FedFS domain globally
Private FedFS domain
If you do not have administrative access to your domain name service, you can set up a forwarding DNS host to which your FedFS-enabled clients refer

Adding a DNS SRV to an existing DNS

Suppose you want to advertise the FedFS domain "example.net. You've already set up your FedFS domain root on an NFS server called server.example.net.

In the zone file for example.net, add the following record:

_nfs-domainroot._tcp            IN SRV          0 0 2049 server.example.net.

Update the zone's serial number, save the zone file, and reload your DNS server (usually "sudo rndc reload" works).

You can add additional SRV records which refer to other NFS servers each exporting a copy of the domain root.

Backwards compatibility

The DNS SRV record for advertising FedFS domain root servers is specified in RFC 6641. Previous versions of this document specified a slightly different and incompatible format. If your domain must support legacy FedFS clients (for example, fedfs-utils-0.8) you may want to provide both the RFC 6641 compliant record and the legacy record.

In the zone file in the example above, add an additional record:

_nfs4._domainroot._tcp          IN SRV          0 0 2049 server.example.net.

Setting up a forwarding DNS

Some of this setup may not be necessary but it is what I use to setup DNS instances for testing. Also many of the files created should be included in a caching nameserver package. Installing the caching nameserver package and making appropriate modifications to turn the caching nameserver into a forwarding nameserver is really all that needs to be done. Of course the fedfs zone files will always be needed.

The example assumes the private IP address range 192.168.1 is being used and a nameserver that is able to satisfy name resolution for external names is at 192.168.1.1. The example hosts perseus.fedfs.org and zeus.fedfs.org are assigned addresses 192.168.1.32 and 192.168.1.31 respectively.

Set up zeus.fedfs.org as a forwarding DNS server

	mkdir -p /var/named/master/fedfs.org
	if [ ! -d /var/named/data ]; then
		mkdir /var/named/data
	fi

Create /var/named/named.root using:

	dig +norec NS > /var/named/named.root

Create /etc/named.rfc1912.zones as:

	// named.rfc1912.zones:
	//
	// ISC BIND named zone configuration for zones recommended by
	// RFC 1912 section 4.1 : localhost TLDs and address zones
	//
	zone "localdomain" IN {
		type master;
		file "localdomain.zone";
		allow-update { none; };
	};

	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; };
	};

	zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN {
		type master;
		file "named.ip6.local";
		allow-update { none; };
	};

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

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

Create /var/named/localdomain.zone as:

	$TTL	86400
	@		IN SOA	localhost root (
					42		; serial (d. adams)
					3H		; refresh
					15M		; retry
					1W		; expiry
					1D )		; minimum
		        IN NS		localhost
	localhost	IN A		127.0.0.1

Create /var/named/localhost.zone

	$TTL	86400
	@		IN SOA	@       root (
					42		; serial (d. adams)
					3H		; refresh
					15M		; retry
					1W		; expiry
					1D )		; minimum

		        IN NS		@
	 		IN A		127.0.0.1
			IN AAAA		::1

Create /var/named/named.local as:

	$TTL	86400
	@       IN      SOA	localhost. root.localhost.  (
					1997022700 ; Serial
					28800      ; Refresh
					14400      ; Retry
					3600000    ; Expire
					86400 )    ; Minimum
		IN      NS      localhost.
	1       IN      PTR     localhost.

Create /var/named/named.ip6.local as:

	$TTL	86400
	@       IN      SOA	localhost. root.localhost.  (
					1997022700 ; Serial
					28800      ; Refresh
					14400      ; Retry
					3600000    ; Expire
					86400 )    ; Minimum
		IN      NS      localhost.
	1	IN      PTR     localhost.

Create /var/named/named.broadcast as:

	$TTL    86400
	@		IN SOA	localhost.      root.localhost. (
 					42              ; serial (d. adams)
					3H              ; refresh
					15M             ; retry
					1W              ; expiry
					1D )            ; minimum
			IN NS	localhost.

Create /var/named/named.zero as:

	$TTL 86400
	@		IN SOA	localhost.      root.localhost. (
					42              ; serial (d. adams)
					3H              ; refresh
					15M             ; retry
					1W              ; expiry
					1D )            ; minimum
			IN NS	localhost.

Create /etc/named.conf as:

	options {
		listen-on port 53 { any; };
		listen-on-v6 port 53 { ::1; };
		directory 	"/var/named";
		allow-query     { any; };
		forwarders { 192.168.1.1; };
		recursion yes;
	};

	logging {
        	channel default_debug {
                	file "data/named.run";
	                severity dynamic;
        	};
	};

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

	include "/etc/named.rfc1912.zones";

	include "/var/named/master/fedfs.org/zone.fedfs.org";

Create /var/named/master/fedfs.org/zone.fedfs.org as:

	zone "fedfs.org" {
	        type master;
        	notify no;
	        file "master/fedfs.org/db.fedfs.org";
	};

	zone "1.168.192.in-addr.arpa" {
        	type master;
	        notify no;
        	file "master/fedfs.org/db.192.168.1";
	};

Create /var/named/master/fedfs.org/db.fedfs.org as:

	$TTL 3D
	@	IN	SOA	ns.fedfs.org. hostmaster.fedfs.org. (
			199802152       ; serial, todays date + todays serial #
			8H              ; refresh, seconds
			2H              ; retry, seconds
			4W              ; expire, seconds
			1D )            ; minimum, seconds
	;
			NS	ns		; Inet Address of name server
	;
	localhost	A	127.0.0.1
	ns		A	192.168.1.32
	zeus		A	192.168.1.32
	perseus	A	192.168.1.31

	; Assume these aren't present, they've been left to show an example
	; of the SRV record that would be used for a read-write FedFS domain
	; rather than the read-only setup we use here.
	;_nfs4._domainroot._tcp		SRV	0 0 2049 perseus.fedfs.org.
	;_nfs4._write._domainroot._tcp	SRV	0 0 2049 perseus.fedfs.org.

Create /var/named/master/fedfs.org/db.192.168.1 as:

	$TTL 3D
	@	IN	SOA	ns.fedfs.org. hostmaster.fedfs.org. (
			199802151 ; Serial, todays date + todays serial
			8H      ; Refresh
			2H      ; Retry
			4W      ; Expire
			1D)     ; Minimum TTL
			NS	ns.fedfs.org.

	32		PTR	ns.fedfs.org.
	32		PTR	zeus.fedfs.org.
	31		PTR	perseus.fedfs.org.

Start the new name service with:

service named start

or

systemctl start named.service
Personal tools