Domain Configuration ValuesBDNS domains are configured using json syntax.
A simple and functional domain configuration value to point your .p2p domain to a server looks like this:{ "ip": "123.45.6.7" }
or with wildcard subdomains all pointing to the same IP address
{ "ip": "123.45.6.7", "map": { "*": "@"} }
There are other fields in this specification for more advanced needs, and more complex examples are shown at the end of this document.
ipDNS Equivalent: A
Type: IPv4 Single or IPv4 Arrayipv4 address(es) for the domain
examples"ip" : "192.168.1.1"
"ip": ["192.168.1.1", "192.168.7.1"]
ip6DNS Equivalent: AAAA
Type: IPv6 Single or IPv6 Arrayipv6 address(es) for the domain
examples"ip6": "2001:4860:0:1001::68"
"ip6": ["2001:4860:0:1001::68"]
nsDNS Equivalent: NS
Type: Host Single or Host ArrayAssigns (a) nameserver(s) to handle address and record resolution for the domain.
The "ns" setting overrides all other settings unless the domain is modified modified by an import value.usage
examples"ns": "ns.myserver.net"
"ns": ["ns.myserver.net", "192.168.3.4"]
mapDefines subdomains as name/value pairs, where the name is the subdomain and the value is a valid Domain Configuration Value.
The Domain Configuration spec is extended in a map to allow for the special name "*", and the reference values "@" and "".
The special name "*" refers to any otherwise undeclared name, i.e., a wildcard subdomain.
The special value "@" refers to the root domain, and "" refers to the parent of the subdomain.
examples "map": {
"www": { "alias" : "@" },
"com": { "alias" : "www.example.com." },
"ftp": { "import": "example-ftp" },
"mx": { "ip": "123.45.6.7" }
}
Using "*" and "@". Any subdomain of <domain> will be resolved as the root <domain>. That is, <anything>.<domain> -> <domain>.
"map": {
"*": { "alias" : "@" }
}
aliasDNS Equivalent: CNAME
Type: Host SinglePoints the domain to another configured domain, using either an absolute reference, or a relative reference in a map.
examplesAlias references a classic domain name:
"alias": "www.example.net."
Alias references another .p2p domain name:
"alias": "www.example.p2p."
Alias references a TOR hidden site:
"alias": "idnxcnkne4qt76tg.onion."
Alias in a map, "www.<domain>" aliases the root domain:
"map": {
"www": { "alias" : "@" }
}
Alias in a nested map, "
www.sub.<domain>" aliases its parent domain "sub.", "ftp.sub.<domain>" references the absolute domain "ftp.example.com" in the classic DNS system:
"map": {
"sub": {
"map": {
"www": { "alias" : "" },
"ftp": { "alias" : "ftp.example.com." }
},
"*": { "alias" : "@" }
}
translateDNS Equivalent: DNAME
Type: Host SingleA Delegation Name as defined in
RFC 6672. Aliases the subtree of one domain to another.
example"translate": "otherhost.bit."
serviceDNS Equivalent: SRV, MX
Type: Array of service recordsService records based on
RFC 2782. These can specify smtp, pop, imap, or other services for the domain.
The format for each service record is:
["service", "protocol", priority, port, "host"]
- service: the symbolic name of the desired service.
- proto: the transport protocol of the desired service; this is usually either TCP or UDP.
- priority: the priority of the target host, lower value means more preferred.
- port: the TCP or UDP port on which the service is to be found.
- host: the canonical hostname of the machine providing the service, ending in a dot.
example "service": [
["smtp", "tcp", 10, 25, "mail.host.p2p."],
["smtp", "tcp", 20, 25, "mail.host.net."],
["pop", "tcp", 0, 110, "mail.host.p2p."]
["imap", "tcp", 0, 143, "imap.host.p2p."]
]
contactDNS Equivalent: SOA, RP
Type: Single or Array of free-textDeclares a contact for the domain, could be email, KeyID, etc...
examples"contact": "hostmaster@example.net"
"contact": ["hostmaster@example.p2p","keyhotee/5oNF5EJXDiMpHASnxxvnzn4GSmxVuEgZ1r25QaXS3MfXEJZgDk"]
locDNS Equivalent: LOC
Type: Single RFC-1876 locationGeolocation. Format is described in
RFC 1876exampleThis example represents 52°22'23?N 4°53'32?E
"loc": "52 22 23.000 N 4 53 32.000 E -2.00m 0.00m 10000m 10m"
importType: Single or Array of BDNS names Merges the domain with the data from another BDNS domain. Imports overwrite local values.
This is useful because of the 1024 character limitation on domain configuration values. Service records for example can get long, and storing some data elsewhere and importing it allows a complex domain to fit within the data limit, as well as allowing sharing of configuration data between domains.
Recursion is possible, and should be checked for.
example"import": "sample-services"
infoType: free-textA place for providing additional notes about the domain
examples"info": "RESERVED"
"info": "buyme@example.bit"
Full examples {
"ip" : "192.168.1.1",
"ip6" : "2001:4860:0:1001::68",
"contact" : "hostmaster@example.bit",
"info" : "Example & Sons Co.",
"service" : [ ["smtp", "tcp", 10, 0, 25, "mail"] ],
"map":
{
"www" : { "alias": "" },
"ftp" : { "ip": ["10.2.3.4", "10.4.3.2"] },
"mail": { "ns": ["ns1.host.net", "ns12.host.net"] }
}
}
{
"ip" : "8.8.8.8",
"map":
{
"us":
{
"ip" : "1.2.3.4",
"map": { "www": { "alias": "" } }
},
"eu":
{
"map": { "www": { "alias": "us.@" } }
},
"*": { "alias": "" }
}
}
Attribution
Concepts and examples in this specification are based in whole or in part on the
Namecoin Domain Name Specification