{"componentChunkName":"component---src-templates-blog-post-js","path":"/blog/what-is-reverse-dns-rdns/","result":{"data":{"site":{"siteMetadata":{"title":"The Official MailPace Blog","author":"Paul, founder of MailPace"}},"mdx":{"id":"a609fed3-3f5c-50e0-b790-f1aa6d1dce93","excerpt":"Background DNS (Domain Name System)  is a system that provides a key-value data store for domain information. Its primary use is to link a domain to an IP…","body":"var _excluded = [\"components\"];\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* @jsxRuntime classic */\n\n/* @jsx mdx */\nvar _frontmatter = {\n  \"title\": \"What is Reverse DNS (rDNS) and how does it work?\",\n  \"date\": \"2021-10-06T09:00:03.284Z\",\n  \"description\": \"A guide to Reverse DNS (rDNS) and PTR records\"\n};\nvar layoutProps = {\n  _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  var components = _ref.components,\n      props = _objectWithoutProperties(_ref, _excluded);\n\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"h2\", null, \"Background\"), mdx(\"p\", null, mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://en.wikipedia.org/wiki/DNS\"\n  }, \"DNS (Domain Name System)\"), \" is a system that provides a key-value data store for domain information. Its primary use is to link a domain to an IP address, although it is often used for other records like \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://blog.mailpace.com/blog/whats-an-spf-record/\"\n  }, \"SPF\"), \" and \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://blog.mailpace.com/blog/whats-a-DKIM-record/\"\n  }, \"DKIM\")), mdx(\"p\", null, \"When you access a website you usually have an easy to read domain, and to find the computer behind that domain your browser will query a DNS server for the IP address associated with it. These records are set by the domain owner, and if you have ever built a website or app you\\u2019re probably familiar with setting this up.\"), mdx(\"p\", null, \"But what about when you know the IP address, but not the domain? Enter Reverse DNS, often stylised as rDNS.\"), mdx(\"h2\", null, \"What is Reverse DNS (rDNS)?\"), mdx(\"p\", null, \"Reverse DNS is a mechanism to identify a domain name associated with an IP address.\"), mdx(\"blockquote\", null, mdx(\"p\", {\n    parentName: \"blockquote\"\n  }, \"If you have an IP address, and you want to know what domain that IP address resolves to, you use an rDNS lookup to find out the domain\")), mdx(\"h2\", null, \"But Why?\"), mdx(\"p\", null, \"The obvious case is for spam filters: email always comes from an IP address, so checking the IP address matches up with the sending domain can be a useful indicator of spam. \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"This is why you should set an rDNS record if you\\u2019re hosting your own email server\"), \".\"), mdx(\"p\", null, \"But there are other situations where rDNS is useful, such as tracking down a hacker by IP address or determining the hosting provider behind an IP address.\"), mdx(\"h2\", null, \"How does it work?\"), mdx(\"p\", null, \"Reverse DNS records are maintained as PTR (short for Pointer) records under the \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://www.iana.org/domains/arpa\"\n  }, \"Address and Routing Parameter Area (ARPA) top level domain\"), \". Most people have never heard this domain, but it is one of the oldest and most important pieces of infrastructure that powers the internet. The \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \".arpa\"), \" TLD is used for domain management of technical network infrastructure across the internet, and was originally introduced in January 1985.\"), mdx(\"p\", null, \"It was intended to be used to transition from \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://en.wikipedia.org/wiki/ARPANET\"\n  }, \"ARPANET\"), \" (a precursor to the Internet), but remains to date and will probably be there indefinitely. \"), mdx(\"p\", null, \"There are two subdomains that are used for rDNS records on \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \".arpa\"), \":\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"in-addr.arpa\"), \" - for IPv4 rDNS records\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"ip6.arpa\"), \" - for IPv6 rDNS records\")), mdx(\"p\", null, \"The name of a PTR rDNS record looks like this:\"), mdx(\"p\", null, mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"<REVERSED IP ADDRESS>.<SUB_DOMAIN>.arpa\")), mdx(\"p\", null, \"Where IP Address is your IPv4 or IPv6 address \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"in reverse\"), \" and Sub Domain is the IPv4 or IPv6 subdomain above. \"), mdx(\"p\", null, \"When we run an rDNS lookup we\\u2019re querying the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \".arpa\"), \" domain for a PTR record that matches the above. The domain that the IP address maps to is also stored in the zone file alongside this and is returned in the lookup.\"), mdx(\"h2\", null, \"How to lookup an rDNS record\"), mdx(\"p\", null, \"We can use the \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://www.isc.org/bind/\"\n  }, \"dig\"), \" command line tool to do a lookup in the DNS records. Here\\u2019s an example using one of our IP addresses:\"), mdx(\"pre\", {\n    \"className\": \"grvsc-container default-dark\",\n    \"data-language\": \"\",\n    \"data-index\": \"0\"\n  }, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"grvsc-code\"\n  }, mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"grvsc-line\"\n  }, \"$ dig -x 193.33.178.182 +noall +answer\"), \"\\n\", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"grvsc-line\"\n  }), \"\\n\", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"grvsc-line\"\n  }, \"; <<>> DiG 9.10.6 <<>> -x 193.33.178.182 +noall +answer\"), \"\\n\", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"grvsc-line\"\n  }, \";; global options: +cmd\"), \"\\n\", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"grvsc-line\"\n  }, \"182.178.33.193.in-addr.arpa. 300 IN\\tPTR\\tmailer.mailpace.com.\"))), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"-x\"), \" tells dig to translate our lookup into an rDNS query\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"+noall\"), \" hides all of the response\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"+answer\"), \" shows the answer itself\")), mdx(\"p\", null, \"The keen-eyed among you will see that the IP address above is backwards, so what we actually have in our PTR record is  \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"182.178.33.193\"), \" (which really means \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"193.33.178.182\"), \") points to \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"mailer.mailpace.com\"), \". This means that when an email comes from this IP address, the rDNS query made by most spam filters will resolve to \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"mailer.mailpace.com\"), \". We set the hostname of our \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"ReplyTo\"), \" header in all our outgoing emails to this domain, so that these email servers can match up the email hostname to our IP using this this mechanism.\"), mdx(\"h2\", null, \"How to set an rDNS record\"), mdx(\"p\", null, \"For most people, the answer is to \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"contact to your web host or server provider\"), \". This is because you need to have IP authority to set an rDNS record. Most web hosts will have a way to set this for you through their UI or support team. \"), mdx(\"p\", null, \"However if you\\u2019re lucky enough to have authority over your IPs you can set these yourself. To do this you need to create the reverse DNS zone on the authoritative DNS nameserver for the IP address of your server. You can find out what your authoritative name server is using \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"dig\"), \".\"), mdx(\"p\", null, \"Create and save a PTR record using the format above ( remember to reverse the IP!) and save it as a new record e.g.\"), mdx(\"p\", null, mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"182.178.33.193.in-addr.arpa. 300 IN\\tPTR\\tmailer.mailpace.com.\")), mdx(\"p\", null, \"And that\\u2019s it!\"), mdx(\"h2\", null, \"Further Reading\"), mdx(\"p\", null, mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://datatracker.ietf.org/doc/html/rfc5855\"\n  }, \"https://datatracker.ietf.org/doc/html/rfc5855\"), \"\\n\", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://en.wikipedia.org/wiki/Reverse_DNS_lookup\"\n  }, \"https://en.wikipedia.org/wiki/Reverse_DNS_lookup\"), \"\\n\", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://en.wikipedia.org/wiki/.arpa#Reverse_IP_address_mapping\"\n  }, \"https://en.wikipedia.org/wiki/.arpa#Reverse_IP_address_mapping\")), mdx(\"style\", {\n    \"className\": \"grvsc-styles\"\n  }, \"\\n  .grvsc-container {\\n    overflow: auto;\\n    -webkit-overflow-scrolling: touch;\\n    padding-top: 1rem;\\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\\n    padding-bottom: 1rem;\\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\\n    border-radius: 8px;\\n    border-radius: var(--grvsc-border-radius, 8px);\\n    font-feature-settings: normal;\\n  }\\n  \\n  .grvsc-code {\\n    display: inline-block;\\n    min-width: 100%;\\n  }\\n  \\n  .grvsc-line {\\n    display: inline-block;\\n    box-sizing: border-box;\\n    width: 100%;\\n    padding-left: 1.5rem;\\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\\n    padding-right: 1.5rem;\\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\\n  }\\n  \\n  .grvsc-line-highlighted {\\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\\n  }\\n  \\n  .default-dark {\\n    background-color: #1E1E1E;\\n    color: #D4D4D4;\\n  }\\n\"));\n}\n;\nMDXContent.isMDXComponent = true;","frontmatter":{"title":"What is Reverse DNS (rDNS) and how does it work?","date":"October 06, 2021","description":"A guide to Reverse DNS (rDNS) and PTR records"}}},"pageContext":{"slug":"/what-is-reverse-dns-rdns/","previous":{"fields":{"slug":"/verify-paddle-webhooks-in-ruby/"},"frontmatter":{"title":"How to Verify Paddle.com Webhooks / Alerts in Ruby on Rails"}},"next":{"fields":{"slug":"/how-to-get-emails-delivered/"},"frontmatter":{"title":"How to get emails delivered"}}}},"staticQueryHashes":["1956864136","63159454"]}