{"id":496,"date":"2020-02-20T09:18:07","date_gmt":"2020-02-20T08:18:07","guid":{"rendered":"https:\/\/blog.mhasin.eu\/?p=496"},"modified":"2020-02-21T07:34:48","modified_gmt":"2020-02-21T06:34:48","slug":"bind-9-ming-dns-block-centosos","status":"publish","type":"post","link":"https:\/\/blog.mhasin.eu\/?p=496","title":{"rendered":"BIND 9 mining DNS block CentOS"},"content":{"rendered":"\n<p>Zablokovanie mining cez DNS<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>yum install perl-Text-Diff\n<\/code><\/pre>\n\n\n\n<p>Script:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nano start.sh<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\n\n#webova adresa na stazeni host tabulky\nweb_host_table=\"https:\/\/raw.githubusercontent.com\/hoshsadiq\/adblock-nocoin-list\/master\/hosts.txt\"\n\n#soubor s novymi daty\nnew_file=\"\/var\/named\/nocoin_new.txt\"\n\n#soubor se starymi daty\nold_file=\"\/var\/named\/nocoin_old.txt\"\n\n##########################################################\nwget -q -O $new_file $web_host_table\ndiff -q $new_file $old_file > \/dev\/null 2>&amp;1\nif [[  $? == 0 ]]\n    then echo \"no new data\"; exit 0\n    else echo \"new data available\"; perl nocoin-bind-pl-1.pl; exit 1\nfi\n<\/code><\/pre>\n\n\n\n<p>Tento script porovna ci su zmeny a ak su zmeny tak ich implementuje do zonoveho suboru<\/p>\n\n\n\n<p>Pre spravnu funcknost je potrebne v DNS nastavit:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nano \/etc\/named.conf<\/code><\/pre>\n\n\n\n<p>v sekcii OPTIONS<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  response-policy {\n    zone \"nocoin.mhasin.eu\";\n    };<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>nano \/etc\/named.rfc1912.zones<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>zone \"nocoin.mhasin.eu\" {\n        file \"\/POLE\/data\/server\/dns-anti-mining\/nocoin.conf\";\n        type master;\n        };\n<\/code><\/pre>\n\n\n\n<p>Stiahnutie celeho projektu:<\/p>\n\n\n\n<div class=\"wp-block-file\"><a href=\"https:\/\/blog.mhasin.eu\/wp-content\/uploads\/2020\/02\/dns-anti-mining.zip\">dns-anti-mining<\/a><a href=\"https:\/\/blog.mhasin.eu\/wp-content\/uploads\/2020\/02\/dns-anti-mining.zip\" class=\"wp-block-file__button\" download><\/a><\/div>\n\n\n\n<p>Pridanie do CRON<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>crontab -e<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>0 0 * * * \/POLE\/data\/server\/dns-anti-mining\/start.sh<\/code><\/pre>\n\n\n\n<p>Zdroj:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>https:\/\/www.root.cz\/clanky\/ochrana-proti-tezbe-kryptomen-pomoci-v-dns-vlastni-rpz-filtr\/<\/code><\/pre>\n\n\n\n<p><\/p>\n<div class=\"pdf24Plugin-cp\"> \t<form name=\"pdf24Form0\" method=\"post\" action=\"https:\/\/doc2pdf.pdf24.org\/wordpress.php\" target=\"pdf24PopWin\" onsubmit=\"var pdf24Win = window.open('about:blank', 'pdf24PopWin', 'resizable=yes,scrollbars=yes,width=600,height=250,left='+(screen.width\/2-300)+',top='+(screen.height\/3-125)+''); pdf24Win.focus(); if(typeof pdf24OnCreatePDF === 'function'){void(pdf24OnCreatePDF(this,pdf24Win));}\"> \t\t<input type=\"hidden\" name=\"blogCharset\" value=\"Cw1x07UAAA==\" \/><input type=\"hidden\" name=\"blogPosts\" value=\"MwQA\" \/><input type=\"hidden\" name=\"blogUrl\" value=\"yygpKSi20tdPyslP18vNSCzOzNNLLQUA\" \/><input type=\"hidden\" name=\"blogName\" value=\"c\/LxdwcA\" \/><input type=\"hidden\" name=\"blogValueEncoding\" value=\"gzdeflate base64\" \/><input type=\"hidden\" name=\"postId_0\" value=\"M7E0AwA=\" \/><input type=\"hidden\" name=\"postTitle_0\" value=\"c\/L0c1GwVMjNzMvMS1dw8QtWSMrJT85WcE7NK\/EPBgA=\" \/><input type=\"hidden\" name=\"postLink_0\" value=\"yygpKSi20tdPyslP18vNSCzOzNNLLdW3L7A1sTQDAA==\" \/><input type=\"hidden\" name=\"postAuthor_0\" value=\"y00syfcwNAIA\" \/><input type=\"hidden\" name=\"postDateTime_0\" value=\"MzIwMtA1MNI1MlAwsLQyMLIyMAcA\" \/><input type=\"hidden\" name=\"postContent_0\" value=\"rVXBjts2EL3rK6bKoocCFG3fGnvVQ9NDgSJeNHtKEBgUNVoxkkiGpKSVi\/x7hlptnWydZl2UOggihzNvZt4bJTubvxVFaxozCK0QOqWVvgOJR3j1+s2O2zyhtbMOQbbC++t0tIzsZcOkKTHNd\/GVT30HSvsg2hYsupbd4n1gr1RVJTs+W5Arh4uz\/I10yoaXz3avhTZA3l3IfH3G4Xeuv\/iBF0rzQvg6SV6MWFCyIEqHXoAW0fERtYLa+ABBFH3bTAlZHeLGgTZavE7rEKx\/ybkTY3anQt0XvUcnjQ6oQyZNx8m69qJUH7koHzBoI43SrFU+8E74gC4aBZ+F+5ASEm\/6wjjwoM0wdQpKEaZE43ioVAzJB+G4Fh2W\/MHTgc6e3sW5Ln\/fNm35zdt09nj7P69kvMMA7COwPVw9QoWrr6uVlNT4aPSFxSMwyIGXOHDdE1U2+Y+is9t1oip49w7g6he4voYVvH+fAK1QowaUtYGU+k++Yo4i3QLeqwCr2QZbKsFisxiAGIRqIxAyjWyEpRFEgpLZlq0z2y5O1kmlzlL0ltpKnJuJCtY4MxBTpALfw7FDPQGFaU5fgT6UrEF1tkXaCf0HhNLA0VBvkdD52K7+xPj8hkjrrROD7qHqtWx0pB\/dsiY4LDTCECVIBKUGD+pStXAM8qH9RE5dnUtxIPY0UinY39z+vr9A7QAkHWu0R2ZNq+QEf829oGQxtioWO+tq4emFfbqdDz9tLxfu00xcJdc\/rzdZDOQvd\/cNfAv6uGaGpvxm\/8dvPFKJk8YHkm2pPRM6KPYwHxdFzZVd0pv5OlmaoLPQT5uftudHYFCi1n2gmSuxjQyxznzAJvSnRpdq+Ec+ESHlI6B2WJ3GEh3enVLiZL6MJt7b1ojS881qs+KrzdNUsqOyaf5kc8fF\/x3ibCKHQ9GHYHRKUhl1dJLPoTllftKJKudfE6np1z\/3r5\/NUukIniiA4eVMWdEQ+ml+vs+Ff\/kv5W9LaurzlftY6nEcM2cM\/VeOnOx1M3Ejaye0YMQSCh3wWCBr3GSDoWlDMuyMVGxgEdxAEYJWzNljrHJw\/By0GdRn\" \/> \t\t<a href=\"https:\/\/www.pdf24.org\" target=\"_blank\" title=\"www.pdf24.org\" rel=\"nofollow\"><img src=\"https:\/\/blog.mhasin.eu\/wp-content\/plugins\/pdf24-post-to-pdf\/img\/pdf_32x32.png\" alt=\"\" border=\"0\" height=\"32\" \/><\/a> \t\t<span class=\"pdf24Plugin-cp-space\">&nbsp;&nbsp;<\/span> \t\t<span class=\"pdf24Plugin-cp-text\">Send article as PDF<\/span> \t\t<span class=\"pdf24Plugin-cp-space\">&nbsp;&nbsp;<\/span> \t\t<input class=\"pdf24Plugin-cp-input\" style=\"margin: 0px;\" type=\"text\" name=\"sendEmailTo\" placeholder=\"Enter email address\" \/> \t\t<input class=\"pdf24Plugin-cp-submit\" style=\"margin: 0px;\" type=\"submit\" value=\"Send\" \/> \t<\/form> <\/div>","protected":false},"excerpt":{"rendered":"Zablokovanie mining cez DNS Script: Tento script porovna ci su zmeny a ak su zmeny tak ich implementuje do zonoveho suboru Pre spravnu funcknost je potrebne v DNS nastavit: v sekcii OPTIONS Stiahnutie celeho projektu: Pridanie do CRON Zdroj: &nbsp;&nbsp; Send article as PDF &nbsp;&nbsp;\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"arc_restricted_post":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-496","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=\/wp\/v2\/posts\/496","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=496"}],"version-history":[{"count":6,"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=\/wp\/v2\/posts\/496\/revisions"}],"predecessor-version":[{"id":511,"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=\/wp\/v2\/posts\/496\/revisions\/511"}],"wp:attachment":[{"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=496"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=496"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=496"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}