{"id":114,"date":"2026-02-11T17:12:48","date_gmt":"2026-02-11T16:12:48","guid":{"rendered":"https:\/\/www.cloutik.com\/?post_type=docs&#038;p=114"},"modified":"2026-02-11T17:12:48","modified_gmt":"2026-02-11T16:12:48","password":"","slug":"dns-scripting","status":"publish","type":"docs","link":"https:\/\/www.cloutik.com\/fr\/knowledge-base\/dns-scripting\/","title":{"rendered":"Scripts DNS"},"content":{"rendered":"<p>Les param\u00e8tres DNS de RouterOS peuvent \u00eatre g\u00e9r\u00e9s dans vos scripts pour diff\u00e9rents objectifs.<\/p>\n\n\n\n<p>Si vous souhaitez automatiser la configuration du service DNS vous disposez d'une commande simple qui peut \u00eatre utilis\u00e9e :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Mikrotik Routerboard : D\u00e9finir les serveurs DNS Google\n\/ip DNS d\u00e9finit les serveurs = 8.8.8.8,8.8.4.4 ;\n<\/code><\/pre>\n\n\n\n<p>Vous pouvez \u00e9galement automatiser la cr\u00e9ation d'entr\u00e9es DNS statiques dans votre appareil (pour le filtrage par exemple), avec deux options : \u2013 domaine direct<\/p>\n\n\n\n<p>La premi\u00e8re option permettra de blacklister un domaine pr\u00e9d\u00e9fini et uniquement ce domaine<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Mikrotik Routerboard : D\u00e9finissez la configuration DNS pour activer Google Safesearch\n\/ip dns static add address=216.239.38.120 ttl=30m comment=Safsearch name=www.google.com;\n<\/code><\/pre>\n\n\n\n<p>L'expression r\u00e9guli\u00e8re est bien plus puissante car la correspondance peut \u00eatre d\u00e9finie avec une expression POSIX, tr\u00e8s adapt\u00e9e pour imposer une liste noire DNS pour un domaine ou une application donn\u00e9e.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Mikrotik Routerboard : Liste noire DNS pour Twitch\n\/ip dns static add address=192.168.88.1 ttl=5m comment=$dnsgroup regexp=\u201d.*\\.twitch\\.tv\u201d;\n<\/code><\/pre>","protected":false},"excerpt":{"rendered":"<p>The DNS settings of RouterOS can be managed within your scripts for different goals. If you want to automate the DNS service configuration you have a simple command that can be used : You can also automate the creation of static DNS entries in your device (for filtering for example), with two options : \u2013 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"doc_category":[11],"doc_tag":[],"class_list":["post-114","docs","type-docs","status-publish","hentry","doc_category-scripts-and-tips"],"year_month":"2026-04","word_count":152,"total_views":0,"reactions":{"happy":0,"normal":0,"sad":0},"author_info":{"name":"tarik.moussaoui","author_nicename":"tarik-moussaoui","author_url":"https:\/\/www.cloutik.com\/fr\/author\/tarik-moussaoui\/"},"doc_category_info":[{"term_name":"Scripts and tips","term_url":"https:\/\/www.cloutik.com\/fr\/docs-category\/scripts-and-tips\/"}],"doc_tag_info":[],"_links":{"self":[{"href":"https:\/\/www.cloutik.com\/fr\/wp-json\/wp\/v2\/docs\/114","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cloutik.com\/fr\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/www.cloutik.com\/fr\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/www.cloutik.com\/fr\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cloutik.com\/fr\/wp-json\/wp\/v2\/comments?post=114"}],"version-history":[{"count":1,"href":"https:\/\/www.cloutik.com\/fr\/wp-json\/wp\/v2\/docs\/114\/revisions"}],"predecessor-version":[{"id":115,"href":"https:\/\/www.cloutik.com\/fr\/wp-json\/wp\/v2\/docs\/114\/revisions\/115"}],"wp:attachment":[{"href":"https:\/\/www.cloutik.com\/fr\/wp-json\/wp\/v2\/media?parent=114"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/www.cloutik.com\/fr\/wp-json\/wp\/v2\/doc_category?post=114"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/www.cloutik.com\/fr\/wp-json\/wp\/v2\/doc_tag?post=114"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}