638天 极客爱好者

重要的人越来越少,剩下的人也越来越重要 ​​

AdGuardHome的安装

发布于 3个月前 / 364 次围观 / 0 条评论 / DNS / 极客爱好者

1、下面的教程支持的系统为debian-64/ubuntu-x64

1.1执行命令

 

apt-get install sudo nano bind9-host



1.2执行命令

cd /opt

1.3执行命令

wget https://static.adguard.com/adguardhome/release/AdGuardHome_linux_amd64.tar.gz
tar xvf AdGuardHome_linux_amd64.tar.gz
cd AdGuardHome

1.4最后执行

sudo ./AdGuardHome -s install

1.5最后浏览器访问ip:3000就可以经行配置了(ip为你服务器的公网ip)

 

对于绑定ip为内网的主机,如阿里云,腾讯云等请新建AdGuardHome.yaml文件
执行命令 nano /opt/AdGuardHome/AdGuardHome.yaml 复制下面的配置进去保存后启动即可。
默认账户admin密码admin
如果想更改账号和密码请安装htpasswd
Ubuntu/debian系统
sudo apt-get install apache2

centos系统
yum install httpd-tools

 

例如账号为admin密码为admin
执行htpasswd -B -n -b admin admin
得到的结果为admin:$2y$05$RDpJrnPXEo5kKvshgFUJPunC1fK0wZlEQpaGhfNyLnFOhaaStIOKm
然后更改下面配置对应的name,password后面的值就ok

 

bind_host: 0.0.0.0
bind_port: 80
users:
- name: admin
  password: $2y$05$RDpJrnPXEo5kKvshgFUJPunC1fK0wZlEQpaGhfNyLnFOhaaStIOKm
language: ""
rlimit_nofile: 0
web_session_ttl: 720
dns:
  bind_host: 0.0.0.0
  port: 53
  statistics_interval: 1
  querylog_enabled: true
  querylog_interval: 90
  querylog_memsize: 0
  protection_enabled: true
  blocking_mode: null_ip
  blocking_ipv4: ""
  blocking_ipv6: ""
  blocked_response_ttl: 60
  ratelimit: 60
  ratelimit_whitelist: []
  refuse_any: true
  bootstrap_dns:
  - 119.29.29.29
  - 202.141.162.123:5353
  - 114.114.114.114
  - 1.1.1.1
  - 223.5.5.5
  - 9.9.9.9
  - 149.112.112.112
  all_servers: true
  edns_client_subnet: false
  allowed_clients: []
  disallowed_clients: []
  blocked_hosts: []
  parental_block_host: family-block.dns.adguard.com
  safebrowsing_block_host: standard-block.dns.adguard.com
  cache_size: 4194304
  upstream_dns:
  - 119.29.29.29
  - 114.114.114.114
  filtering_enabled: true
  filters_update_interval: 24
  parental_sensitivity: 0
  parental_enabled: false
  safesearch_enabled: false
  safebrowsing_enabled: false
  safebrowsing_cache_size: 1048576
  safesearch_cache_size: 1048576
  parental_cache_size: 1048576
  cache_time: 30
  rewrites: []
  blocked_services: []
tls:
  enabled: false
  server_name: ""
  force_https: false
  port_https: 443
  port_dns_over_tls: 853
  allow_unencrypted_doh: false
  certificate_chain: ""
  private_key: ""
  certificate_path: ""
  private_key_path: ""
filters:
- enabled: true
  url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
  name: AdGuard Simplified Domain Names filter
  id: 1
- enabled: false
  url: https://adaway.org/hosts.txt
  name: AdAway
  id: 2
- enabled: false
  url: https://hosts-file.net/ad_servers.txt
  name: hpHosts - Ad and Tracking servers only
  id: 3
- enabled: false
  url: https://www.malwaredomainlist.com/hostslist/hosts.txt
  name: MalwareDomainList.com Hosts List
  id: 4
user_rules: []
dhcp:
  enabled: false
  interface_name: ""
  gateway_ip: ""
  subnet_mask: ""
  range_start: ""
  range_end: ""
  lease_duration: 86400
  icmp_timeout_msec: 1000
clients: []
log_file: ""
verbose: false
schema_version: 6

 

 

可能需要控制服务的其他命令。

  • ./AdGuardHome -s uninstall -卸载AdGuard Home服务。
  • ./AdGuardHome -s start -启动服务。
  • ./AdGuardHome -s stop -停止服务。
  • ./AdGuardHome -s restart -重新启动服务。
  • ./AdGuardHome -s status -显示当前服务状态。