{"id":348,"date":"2021-07-23T12:28:14","date_gmt":"2021-07-23T12:28:14","guid":{"rendered":"https:\/\/ssdsunucum.com\/blog\/how-to-prevent-cpanel-users-from-creating-certain-domains\/"},"modified":"2021-07-23T12:28:14","modified_gmt":"2021-07-23T12:28:14","slug":"how-to-prevent-cpanel-users-from-creating-certain-domains","status":"publish","type":"post","link":"https:\/\/ssdsunucum.com\/blog\/how-to-prevent-cpanel-users-from-creating-certain-domains\/","title":{"rendered":"How to Prevent cPanel Users from Creating Certain Domains"},"content":{"rendered":"<\/p>\n<div class=\"col-md-9\">\n<div class=\"flex-column flex-md-row article-header\"><\/div>\n<hr>\n<h2 id=\"overview\">Overview<\/h2>\n<p>cPanel &#038; WHM allows you to deny cPanel users the ability to create certain domains or use certain top-level domains (TLDs). This feature is useful, for example, to deny cPanel users the ability to park a well-known domain (such as <code>google.com<\/code>) on top of a domain.<\/p>\n<p>For more information about the domains that cPanel users can create, read our Aliases and Addon Domains documentation.<\/p>\n<h2 id=\"add-to-the-list-of-user-denied-domains\">Add to the list of user-denied domains<\/h2>\n<p>To add to the list of domains that cPanel &#038; WHM does not allow users to create, perform the following steps:<\/p>\n<ol>\n<li>\n<p>From the command line, run the following command to view the default list of domains that cPanel &#038; WHM does not allow users to create. <\/p>\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-perl\" data-lang=\"perl\">cat <span style=\"color:#e6db74\">\/usr\/<\/span>local<span style=\"color:#e6db74\">\/cpanel\/<\/span>etc<span style=\"color:#f92672\">\/<\/span>commondomains<\/code><\/pre>\n<\/div>\n<ul>\n<li>If the file contains a large number of entries, run the <code>grep 'example.com' \/usr\/local\/cpanel\/etc\/commondomains<\/code> command to determine whether the <code>example.com<\/code> domain exists in the list.\n<div class=\"callout callout-danger\">\n<div class=\"callout-heading\">Warning:<\/div>\n<div class=\"callout-content\">\n        Do <strong>not<\/strong> edit this file directly. System updates overwrite any changes to this file. Instead, follow the next step to create a new file.\n    <\/div>\n<\/div>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>With a text editor, add the domains and TLDs that you do <strong>not<\/strong> want to allow users to create to the <code>\/var\/cpanel\/commondomains<\/code> file.<\/p>\n<ul>\n<li>\n<p>Add each domain or TLD on a separate line, and do <strong>not<\/strong> prepend or append a dot to the domains. For example: <\/p>\n<div class=\"highlight\">\n<div style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\">\n<table style=\"border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block;\">\n<tr>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-go\" data-lang=\"go\"><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">1\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">2\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">3\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">4\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">5\n<\/span><\/code><\/pre>\n<\/td>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;;width:100%\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-go\" data-lang=\"go\"><span style=\"color:#a6e22e\">a<\/span>.<span style=\"color:#a6e22e\">com<\/span>\n<span style=\"color:#a6e22e\">b<\/span>.<span style=\"color:#a6e22e\">com<\/span>\n<span style=\"color:#a6e22e\">c<\/span>.<span style=\"color:#a6e22e\">com<\/span>\n.<span style=\"color:#a6e22e\">cat<\/span>\n.<span style=\"color:#a6e22e\">ninja<\/span><\/code><\/pre>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<\/div>\n<\/li>\n<li>\n<p><strong>Only<\/strong> add domain names and TLDs to this file (for example, <code>example.com<\/code>). When you list a domain name, cPanel &#038; WHM will automatically prevent the creation of subdomains for that domain or domains under a TLD. For example, if you list the <code>example.com<\/code> domain, users also cannot create the <code>sub.example.com<\/code> domain.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>In the <em>Domains<\/em> section of WHM\u2019s <em>Tweak Settings<\/em> interface (<em>WHM &gt;&gt; Home &gt;&gt; Server Configuration &gt;&gt; Tweak Settings<\/em>), set the <em>Prevent cPanel users from creating specific domains<\/em> setting to <em>On<\/em>.<\/p>\n<\/li>\n<\/ol><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Overview cPanel &#038; WHM allows you to deny cPanel users the ability to create certain domains or use certain top-level domains (TLDs). This feature is useful, for example, to deny cPanel users the ability to park a well-known domain (such as google.com) on top of a domain. For more information about the domains that cPanel &hellip;<\/p>\n","protected":false},"author":1,"featured_media":349,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts\/348"}],"collection":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/comments?post=348"}],"version-history":[{"count":0,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts\/348\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/media\/349"}],"wp:attachment":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/media?parent=348"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/categories?post=348"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/tags?post=348"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}