Maza, like Pi-hole but local and using your macOS or Linux

栏目: IT技术 · 发布时间: 5年前

内容简介:Simple, native and efficient local advertising blocker. Compatible with OSX and Linux.

Maza ad blocking - Like Pi-hole but local and using your operating system

Maza, like Pi-hole but local and using your macOS or Linux

Simple, native and efficient local advertising blocker. Compatible with OSX and Linux.

Maza, like Pi-hole but local and using your macOS or Linux

  • You don't have to install any browser extensions or applications, you just use the tools of your operating system.
  • You update the list of DNS to be blocked with a single stroke.
  • Opensource.
  • Just bash.

:runner:‍Run

:satellite: Update database

maza update

:hammer: Start

sudo maza start

Stop

sudo maza stop

⚖️ Status

maza status

⚙️ Install

:eyes: Requirements

  • bash 4.0 or higher
  • curl
  • Only OSX users, gsed : brew install gnu-sed

Then you do this.

curl -o maza https://raw.githubusercontent.com/tanrax/maza-ad-blocking/master/maza && chmod +x maza && sudo mv maza /usr/local/bin

:hocho: Uninstall

sudo rm /usr/local/bin/maza && sudo rm -r ~/.maza

DNSMASQ

Unfortunately the hosts file does not support sub-domains (wildcards), which is necessary to correctly filter all DNS. You will need to install locally a server for that purpose, Maza supports the Dnsmasq format. Here's an example for OSX.

1 Install

brew install dnsmasq

2 Configure

Edit the file.

/usr/local/etc/dnsmasq.conf

Add the following lines.

conf-file=(your user path)/.maza/dnsmasq.conf

Start DNSMASQ.

sudo brew services stop dnsmasq
sudo brew services start dnsmasq

3 Tell your OS to use your DNS server

Delete the list of OSX DNS servers and add the 3 addresses. The first one will be your local server, and the other 2 belong to OpenDNS, which you can use any other.

127.0.0.1
208.67.222.222
208.67.220.220

Refresh your DNS cache

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

Bonus: dnsmasq is in charge of solving all DNS

Add in confiigure file: /usr/local/etc/dnsmasq.conf

no-resolv
server=208.67.222.222
server=208.67.220.220

Bonus: dnsmasq have test domains

If you want all your .localhost domains, for example, point to localhost add in confiigure file: /usr/local/etc/dnsmasq.conf

address=/.localhost/127.0.0.1

:warning: CAUTION

/etc/hosts

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

超越门户

超越门户

吴晨光 / 中国人民大学出版社 / 2015-4-17 / 39.80

在这个PC端影响力下降、人们对手机的依赖与日俱增的时代,这种探索的意义非同寻常,可以说是试图树立新媒体时代的行业标准。 ——陈彤(小米内容投资与运营副总裁、新浪网前总编辑、资深网络媒体人) 我将对此书的阅读,视作对往日岁月的怀念,它提醒我,自己曾 投身于多么富有蓬勃朝气和探索精神的事业。而对这种事业的原则、逻辑和方法的继承和继续学习,对于互联网时代的企业形象塑造 ,同样有融会变通的参考......一起来看看 《超越门户》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

html转js在线工具
html转js在线工具

html转js在线工具