{"id":5307,"date":"2018-06-17T02:58:21","date_gmt":"2018-06-17T02:58:21","guid":{"rendered":"https:\/\/www.truehost.co.ke\/support\/?post_type=ht_kb&#038;p=5307"},"modified":"2025-04-09T15:09:05","modified_gmt":"2025-04-09T15:09:05","password":"","slug":"set-up-forward-dns-zone-on-your-vps","status":"publish","type":"docs","link":"https:\/\/truehost.com\/support\/knowledge-base\/set-up-forward-dns-zone-on-your-vps\/","title":{"rendered":"Set up Forward DNS zone on your VPS"},"content":{"rendered":"<p>Requirements<\/p>\n<ul>\n<li>VPS installed with CentOS<\/li>\n<li>Registered domain name<\/li>\n<\/ul>\n<p>1. Access the VPS via SSH<\/p>\n<p>2. Install bind and dnsutils, which will allow us to use the dig command later on<\/p>\n<p><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: small;\"><b>Centos or Fedora: yum install bind dnsutils<\/b><\/span><\/span><\/p>\n<p><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: small;\"><b>Ubuntu ir Debian: apt-get install bind9 dnsutils<\/b><\/span><\/span><\/p>\n<p>3. Create a DNS zone file for the domain that will use the name servers. If the domain is called example.com, here is a sample zone file for the domain. The zone file will be called example.com.db. Save this zone file in \/var\/named. I will assume your server IP is 10.10.10.10. This file will help map your domain name to the IP.<\/p>\n<pre class=\"western\"><b>;<\/b>\r\n<b>; BIND data file for  example.com<\/b>\r\n<b>;<\/b>\r\n<b>$TTL    3h<\/b>\r\n<b>@       IN      SOA     ns1.example.com. admin.example.com. (<\/b>\r\n                          <b>1        ; Serial<\/b>\r\n                          <b>3h       ; Refresh after 3 hours<\/b>\r\n                          <b>1h       ; Retry after 1 hour<\/b>\r\n                          <b>1w       ; Expire after 1 week<\/b>\r\n                          <b>1h )     ; Negative caching TTL of 1 day<\/b>\r\n<b>;<\/b>\r\n<b>@       IN      NS      ns1.example.com.<\/b>\r\n<b>@       IN      NS      ns2.example.com.<\/b>\r\n\r\n\r\n<b>example.com.    IN      MX      10      mail.example.com.<\/b>\r\n<b>example.com.    IN      A       10.10.10.10<\/b>\r\n<b>ns1                     IN      A       10.10.10.10<\/b>\r\n<b>ns2                     IN      A       10.10.10.10<\/b>\r\n<b>www                     IN      CNAME   example.com.<\/b>\r\n<b>mail                    IN      A       10.10.10.10<\/b>\r\n<b>ftp                     IN      CNAME   example.com.<\/b><\/pre>\n<pre class=\"western\"><\/pre>\n<p>4. Whta you need for your site to go online is a forward DNS as the one we have created above. Now, Update the BIND configuration file. Note that, at this point, you should have the following file<\/p>\n<p><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: small;\"><b>\/var\/named\/example.com.db<\/b><\/span><\/span><\/p>\n<p>Now, simply open the Bind configuration file using your favourite editor.<\/p>\n<p><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: small;\"><b>vim \/etc\/named.conf<\/b><\/span><\/span><\/p>\n<p>Then add the following code. Remeber to change example.com to your domain name<\/p>\n<p><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: small;\"><b>zone &#8220;example.com&#8221; {<\/b><\/span><\/span><\/p>\n<p><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: small;\"><b>type master;<\/b><\/span><\/span><\/p>\n<p><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: small;\"><b>file &#8220;\/var\/named\/example.com.db&#8221;;<\/b><\/span><\/span><\/p>\n<p><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: small;\"><b>};<\/b><\/span><\/span><\/p>\n<p>5. Lastly, add an IP address of a stable DNS server in your \/etc\/resolv.conf file. For example, if you wish to add google\u2019s DNS server, comment our the content of \/etc\/resolv.conf and add the following line:<\/p>\n<p><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: small;\"><b>nameserver 8.8.4.4<\/b><\/span><\/span><\/p>\n<pre class=\"western\"><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Requirements VPS installed with CentOS Registered domain name 1. Access the VPS via SSH 2. Install bind and dnsutils, which will allow us to use the dig command later on Centos or Fedora: yum install bind dnsutils Ubuntu ir Debian: apt-get install bind9 dnsutils 3. Create a DNS zone file for the domain that will [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"_eb_attr":"","_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"doc_category":[2140],"doc_tag":[],"class_list":["post-5307","docs","type-docs","status-publish","hentry","doc_category-dns"],"year_month":"2026-07","word_count":304,"total_views":0,"reactions":{"happy":0,"normal":0,"sad":0},"author_info":{"name":"w m","author_nicename":"wm","author_url":"https:\/\/truehost.com\/support\/author\/wm\/"},"doc_category_info":[{"term_name":"DNS","term_url":"https:\/\/truehost.com\/support\/docs-category\/dns\/"}],"doc_tag_info":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Set up Forward DNS zone on your VPS -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/truehost.com\/support\/knowledge-base\/set-up-forward-dns-zone-on-your-vps\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Set up Forward DNS zone on your VPS -\" \/>\n<meta property=\"og:description\" content=\"Requirements VPS installed with CentOS Registered domain name 1. Access the VPS via SSH 2. Install bind and dnsutils, which will allow us to use the dig command later on Centos or Fedora: yum install bind dnsutils Ubuntu ir Debian: apt-get install bind9 dnsutils 3. Create a DNS zone file for the domain that will [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/truehost.com\/support\/knowledge-base\/set-up-forward-dns-zone-on-your-vps\/\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-09T15:09:05+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/set-up-forward-dns-zone-on-your-vps\\\/\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/set-up-forward-dns-zone-on-your-vps\\\/\",\"name\":\"Set up Forward DNS zone on your VPS -\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#website\"},\"datePublished\":\"2018-06-17T02:58:21+00:00\",\"dateModified\":\"2025-04-09T15:09:05+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/set-up-forward-dns-zone-on-your-vps\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/set-up-forward-dns-zone-on-your-vps\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/set-up-forward-dns-zone-on-your-vps\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/truehost.com\\\/support\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Set up Forward DNS zone on your VPS\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#website\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/\",\"name\":\"\",\"description\":\"Help In a Click\",\"publisher\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/truehost.com\\\/support\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#organization\",\"name\":\"Truehost Kenya\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/cropped-image_2026-04-16_174808866.png\",\"contentUrl\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/cropped-image_2026-04-16_174808866.png\",\"width\":240,\"height\":48,\"caption\":\"Truehost Kenya\"},\"image\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#\\\/schema\\\/logo\\\/image\\\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Set up Forward DNS zone on your VPS -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/truehost.com\/support\/knowledge-base\/set-up-forward-dns-zone-on-your-vps\/","og_locale":"en_US","og_type":"article","og_title":"Set up Forward DNS zone on your VPS -","og_description":"Requirements VPS installed with CentOS Registered domain name 1. Access the VPS via SSH 2. Install bind and dnsutils, which will allow us to use the dig command later on Centos or Fedora: yum install bind dnsutils Ubuntu ir Debian: apt-get install bind9 dnsutils 3. Create a DNS zone file for the domain that will [&hellip;]","og_url":"https:\/\/truehost.com\/support\/knowledge-base\/set-up-forward-dns-zone-on-your-vps\/","article_modified_time":"2025-04-09T15:09:05+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/truehost.com\/support\/knowledge-base\/set-up-forward-dns-zone-on-your-vps\/","url":"https:\/\/truehost.com\/support\/knowledge-base\/set-up-forward-dns-zone-on-your-vps\/","name":"Set up Forward DNS zone on your VPS -","isPartOf":{"@id":"https:\/\/truehost.com\/support\/#website"},"datePublished":"2018-06-17T02:58:21+00:00","dateModified":"2025-04-09T15:09:05+00:00","breadcrumb":{"@id":"https:\/\/truehost.com\/support\/knowledge-base\/set-up-forward-dns-zone-on-your-vps\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/truehost.com\/support\/knowledge-base\/set-up-forward-dns-zone-on-your-vps\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/truehost.com\/support\/knowledge-base\/set-up-forward-dns-zone-on-your-vps\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/truehost.com\/support\/"},{"@type":"ListItem","position":2,"name":"Set up Forward DNS zone on your VPS"}]},{"@type":"WebSite","@id":"https:\/\/truehost.com\/support\/#website","url":"https:\/\/truehost.com\/support\/","name":"","description":"Help In a Click","publisher":{"@id":"https:\/\/truehost.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/truehost.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/truehost.com\/support\/#organization","name":"Truehost Kenya","url":"https:\/\/truehost.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/truehost.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2026\/04\/cropped-image_2026-04-16_174808866.png","contentUrl":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2026\/04\/cropped-image_2026-04-16_174808866.png","width":240,"height":48,"caption":"Truehost Kenya"},"image":{"@id":"https:\/\/truehost.com\/support\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs\/5307","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/comments?post=5307"}],"version-history":[{"count":1,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs\/5307\/revisions"}],"predecessor-version":[{"id":5327,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs\/5307\/revisions\/5327"}],"wp:attachment":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/media?parent=5307"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/doc_category?post=5307"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/doc_tag?post=5307"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}