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

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

查看所有标签

猜你喜欢:

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

搜

(美)约翰·巴特利 / 张岩、魏平 / 中信出版社 / 2006-1 / 35.00元

这个世界需要什么?如何任何一家公司能回答好这个问题,它就掌握了控制商业社会,乃至整个人类文明的万能钥匙。在过去的几年中,Google正在为获得这把钥匙而努力。虽然Google并非搜索业务的最早开发者,但它凭借着简明、便利、实用的搜索技术和理念,逐渐击败雅虎、Alta Vista等搜索领域的先锋,成为搜索行业名副其实的王者。 本书描述了Google如何从斯坦福一个不起眼的公司迅速崛起为“......一起来看看 《搜》 这本书的介绍吧!

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

Base64 编码/解码

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试