adding dns in named db file directly

 For Directadmin


Adding a SRV recordLast Modified: Apr 30, 2013, 1:58 pm
SRV records provide a standard way of allowing services to use different values, and for a program to determine what those connection values are.

Related Wikipedia page:
http://en.wikipedia.org/wiki/SRV_record

As per the Wikipedia page, the format will look like this:

_service._proto.name TTL class SRV priority weight port target


We'll use their example:

_sip._tcp.example.com. 86400 IN SRV 0 5 5060 sipserver.example.com.

The red portion goes onto the left side of the SRV record in DA, and the blue portion goes onto the right side (DA sets the TTL automatically for you)

The Red portion of the contains the service, protocol, and name, in that order, separated by the period '.' character.

In the above example, the values match up as follows:

service:  _sip
protocol: _tcp
name:     example.com.

priority: 0
weight:   5
port:     5060
target:   sipserver.example.com.



Note that the "name" value will always match the name of the zone.
As such, these 2 left-side values are equivalent, and either could be used:

_sip._tcp.example.com.
_sip._tcp

where any left-side value that does not end with a period '.' will have the zone name appended to the end.

The "target" value can be any domain value, but should resolve using an A or CNAME record.
The same rule about the value ending in a period applies, and would be mandatory if the target is on a different domain name.

Using SRV and TXT records

The DNS lookup routine looks for SRV records first. If one or more servers are found, this server information is used and the second algorithm, which is based on TXT records that emulate SRV records, is not used. The use of SRV records for finding the address of servers is described in RFC 2052. Proper use of SRV records permits the administrator to distribute a service across multiple hosts within a domain, to move the service from host to host without disruption, and to designate certain hosts as primary and others as alternates.

TXT records are simply character strings that are associated with a DNS resource name. LDAP uses TXT records to associate LDAP server information with a DNS host name. To implement the technique that is described in RFC 2052, the DNS name server must support both SRV and TXT records.

An SRV resource record (RR) has the following components:
    service.protocol.domain ttl class SRV priority weight port target
The fields are positional and are defined as follows:
service
Symbolic name of the service. The service name is formed by concatenating the service key and the eNetwork domain name (if any). The LDAP client accepts either ldap or _ldap for the service key. The latest version of RFC 2052 recommends the use of _ldap instead of ldap.
protocol
Protocol used to access the service. The LDAP client accepts either tcp or _tcp. The latest version of RFC 2052 recommends the use of _tcp instead of tcp.
domain
Domain name associated with the resource record.
ttl
Time-to-live in seconds.
class
Class (must be IN for internet).
SRV
Indicates this is an SRV record.
priority
Service priority. LDAP servers are ordered by priority with the lower priority numbers ordered before the higher priority numbers. Set the priority to 0 if priority ordering is not wanted.
weight
Load balancing within the same priority. A higher weight number indicates that the server can handle more requests than a lower weight number. The probability that a server is ordered early in the list increases as the weight increases. Set the weight to 0 if load balancing is not wanted. Otherwise, use nonzero values for all the weights within the same priority. (An SRV record with a weight of 0 has a low probability of being ordered before an SRV record with a nonzero weight).
port
The port assigned to the LDAP server. This value is ignored if the target address record has a service TXT record. If the port number is 0, the port is set to 389.
target
The name of the target address resource record (AAAAA, or A6). The host name used to connect to the LDAP server is obtained from the service TXT record associated with this resource name. If there is no service TXT record defined for the target, the IP address is obtained from the address record.
A TXT record has the following format:
    name TXT "string"
The fields are positional and are defined as follows:
name
Resource name associated with the TXT record.
TXT
Indicates this is a TXT record.
string
Text value.
A TXT record defining a non-SSL server connection has the following format:
    name TXT "service:ldap://host-name[:port][/naming-context]"
The host name must be specified. The port defaults to 389 if it is not specified. A naming context can be specified to allow server entries to be selectively filtered based upon a distinguished name. Multiple service TXT records must be defined if more than one naming context is defined for a single LDAP server or if the LDAP server supports both SSL and non-SSL connections.
A TXT record defining an SSL server connection has the following format:
    name TXT "service:ldaps://host-name[:port][/naming-context]"
The host name must be specified. The port defaults to 636 if it is not specified. A naming context can be specified to allow server entries to be selectively filtered based upon a distinguished name. Multiple service TXT records must be defined if more than one naming context is defined for a single LDAP server or if the LDAP server supports both SSL and non-SSL connections.
A TXT record defining a master LDAP server has the following format:
    name TXT "ldaptype:master"
The last ldaptype TXT record encountered is used if more than one ldaptype TXT record is defined for the same target.
A TXT record defining a replica LDAP server has the following format:
    name TXT "ldaptype:replica"
The last ldaptype TXT record encountered is used if more than one ldaptype TXT record is defined for the same target.
A TXT record defining server vendor information has the following format:
    name TXT "ldapvendor:vendor-information"
The LDAP client does not use the vendor information but makes it available to the application. The last ldapvendor TXT record encountered is used if more than one ldapvendor TXT record is defined for the same target.
A TXT record defining general server information has the following format:
    name TXT "ldapinfo:general-information"
The LDAP client does not use the general information but makes it available to the application. The last ldapinfo TXT record encountered is used if more than one ldapinfo TXT record is defined for the same target.

Example of DNS resource records

The following are the DNS resource records that correspond to the sample server information file described in Example of a server information file. These examples assume that the DNS name server database provides appropriate default values for the ttl and class fields, the resource record name can be omitted if it is the same as the preceding record, and the domain origin is endicott.ibm.com.
    ldap.research.tcp SRV 0 0 0 sysa
                      SRV 5 0 0 backup
    _ldap._tcp        SRV 0 0 0 sysb
                      SRV 0 0 0 replica
    sysa              A   9.130.25.34
                      TXT "service:ldap://sysa.endicott.ibm.com:389"
                      TXT "service:ldaps://sysa.endicott.ibm.com:636"
    backup            A   9.130.25.35
                      TXT "service:ldap://backup.endicott.ibm.com:389"
                      TXT "service:ldaps://backup.endicott.ibm.com:636"
    sysb              A   9.130.36.4
                      TXT "service:ldaps://sysb.endicott.ibm.com:636/dc=ibm,dc=com"
                      TXT "service:ldaps://sysb.endicott.ibm.com:636/o=ibm,c=us"
                      TXT "ldaptype:master"
    replica           A   9.130.36.5
                      TXT "service:ldaps://replica.endicott.ibm.com:636/dc=ibm,dc=com"
                      TXT "service:ldaps://replica.endicott.ibm.com:636/o=ibm,c=us"
                      TXT "ldaptype:replica"

Note that there are two service TXT records for sysa.endicott.ibm.com and backup.endicott.ibm.com, one for the non-SSL port and one for the SSL port. Similarly, there are two service TXT records for sysb.endicott.ibm.com and replica.endicott.ibm.com: one for naming context "dc=ibm,dc=com" and one for naming context "o=ibm,c=us".

These LDAP servers could also be defined using a single service TXT record for each resource name. In this case, multiple SRV and host address records are needed. While it is preferable to use a single SRV record for each LDAP server, some implementations of the LDAP DNS support might require multiple SRV records with a single service TXT record for each resource name. The definitions would then be as follows:
    ldap.research.tcp SRV 0 0 0 sysa
                      SRV 0 0 0 sysasec
                      SRV 5 0 0 backup
                      SRV 5 0 0 backupsec
    _ldap._tcp        SRV 0 0 0 sysb1
                      SRV 0 0 0 sysb2
                      SRV 0 0 0 replica1
                      SRV 0 0 0 replica2
    sysa              A   9.130.25.34
                      TXT "service:ldap://sysa.endicott.ibm.com:389"
    sysasec           A   9.130.25.34
                      TXT "service:ldaps://sysa.endicott.ibm.com:636"
    backup            A   9.130.25.35
                      TXT "service:ldap://backup.endicott.ibm.com:389"
    backupsec         A   9.130.25.35
                      TXT "service:ldaps://backup.endicott.ibm.com:636"
    sysb1             A   9.130.36.4
                      TXT "service:ldaps://sysb.endicott.ibm.com:636/dc=ibm,dc=com"
                      TXT "ldaptype:master"
    sysb2             A   9.130.36.4
                      TXT "service:ldaps://sysb.endicott.ibm.com:636/o=ibm,c=us"
                      TXT "ldaptype:master"
    replica1          A   9.130.36.5
                      TXT "service:ldaps://replica.endicott.ibm.com:636/dc=ibm,dc=com"
                      TXT "ldaptype:replica"
    replica2          A   9.130.36.5
                      TXT "service:ldaps://replica.endicott.ibm.com:636/o=ibm,c=us"
                      TXT "ldaptype:replica"

Comments

Popular posts from this blog

cpanel exam CPSP Answers

How to install zimbra collaboration suite 8.8.11 on CentOS 7

awstats installation