Reverse domain name notation

This article is about the Java-like naming convention. For network process, see Reverse DNS lookup.

Reverse domain name notation (or reverse-DNS) is a naming convention for the components, packages, and types used by a programming language, system or framework. A characteristic of reverse-DNS strings is that they are based on registered domain names, and are only reversed for sorting purposes. For example, if a company making a product called "MyProduct" has the registered domain name "", they could use the reverse-DNS-ish string "com.example.MyProduct" to describe it. Reverse-DNS names are a simple way of reducing name-space collisions, since any domain name is registered by only one party at a time.


Reverse-DNS first became widely used with the Java platform, and has since been used for other systems, for example, ActionScript 3 packages and Android applications.


Examples of systems that use Reverse-DNS are Sun Microsystems' Java platform and Apple's Uniform Type Identifier or UTI. The Android operating system also makes use of the notation for classifying applications, as the Dalvik virtual machine made use of Java.

dconf which is the configuration backend used by GNOME.

Example of reverse-DNS strings are:

Regular expression




static string ReverseDomainName(string domain)
    return string.Join(".", domain.Split('.').Reverse());

Java 8 and later[1]

static String reverseDomain(String domain) {    
    return Arrays.asList(domain.split("\\.")).stream()


function reverseDomain(domain) {
    return domain.split('.').reverse().join('.');


function reverseDomain($domain) {
    return implode('.', array_reverse(explode('.', $domain)));


def reverse_domain(domain):
    return '.'.join(reversed(domain.split('.')))


def reverse_domain(domain)


func reversed(domain: String) -> String {
    return domain
        .components(separatedBy: ".")
        .joined(separator: ".")


  1. "". Retrieved 2016-02-12.

External links

This article is issued from Wikipedia - version of the 10/15/2016. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.