dns over https 简单测试(docker 运行)
dns over https 已经成为了标准了,给予我们的dns 解析添加了安全的支持
测试项目使用docker && docker-compose 运行
一张参考图

环境准备
- dnscrypt-proxy (dns 代理的)
直接下载了linux 版本,并安装依赖
https://github.com/jedisct1/dnscrypt-proxy/releases
- doh server
使用源码编译安装,使用docker 的multi stage 构建
- nginx
使用openresty
docker-compose
- 文件
version: "3"
services:
nginx:
image: openresty/openresty:alpine
ports:
- "443:443"
- "8080:80"
volumes:
- "./nginx/nginx.conf:/usr/local/openresty/nginx/conf/nginx.conf"
- "./nginx/cert/apicaddy.com/cert1.pem:/usr/local/openresty/nginx/conf/cert1.pem"
- "./nginx/cert/apicaddy.com/privkey1.pem:/usr/local/openresty/nginx/conf/privkey1.pem"
dns-server:
image: dalongrong/doh-server
volumes:
- "./dns-server/doh-server.conf:/app/doh-server.conf"
build:
context: ./dns-server
dockerfile: Dockerfile
dns-proxy:
image: dalongrong/dnscrypt-proxy
build:
context: ./dns-proxy
dockerfile: Dockerfile
- nginx 配置
worker_processes auto;
events {
worker_connections 65535;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
real_ip_header X-Forwarded-For;
real_ip_recursive on;
server {
listen 80;
server_name localhost;
charset utf-8;
location / {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
client_body_buffer_size 10M;
client_max_body_size 10G;
proxy_buffers 1024 4k;
proxy_pass http://dns-server:8053;
real_ip_header X-Forwarded-For;
real_ip_recursive on;
}
location /dns-query {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_redirect off;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 86400;
proxy_pass http://dns-server:8053/dns-query ;
}
}
server {
listen 443 ssl http2;
server_name app.apicaddy.com;
ssl_certificate cert1.pem;
ssl_certificate_key privkey1.pem;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:AES256+EECDH:AES256+EDH';
ssl_prefer_server_ciphers on;
location / {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
client_body_buffer_size 10M;
client_max_body_size 10G;
proxy_buffers 1024 4k;
proxy_pass http://dns-server:8053;
real_ip_header X-Forwarded-For;
real_ip_recursive on;
}
location /dns-query {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_redirect off;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 86400;
proxy_pass http://dns-server:8053/dns-query ;
}
}
}
- 修改配置文件
因为运行的时候没有启动ipv6 ,同时默认大部分软件绑定的端口是127.0.0.1
doh-server 配置修改
listen = [
"0.0.0.0:8053",
]
。。。。
upstream = [
# "1.1.1.1:53",
# "1.0.0.1:53",
# "8.8.8.8:53",
# "8.8.4.4:53",
"dns-proxy:53"
]
dnscrypt-proxy 配置:
listen_addresses = ['0.0.0.0:53']

构建&测试
- 构建
docker-compose up -d
- 测试
查询参数的意思参考 https://developers.google.com/speed/public-dns/docs/dns-over-https
http 实际上也是可以访问的,只是及时必须使用https
请求log

说明
dns over https 是很不错的东西,从安全以及灵活性,都是比较方便的,更多的使用还有待仔细研究
参考资料
https://github.com/jedisct1/dnscrypt-proxy/releases
https://www.aaflalo.me/2018/10/tutorial-setup-dns-over-https-server/
https://github.com/rongfengliang/dns-proxy-demo
https://github.com/m13253/dns-over-https
https://developers.google.com/speed/public-dns/docs/dns-over-https
dns over https 简单测试(docker 运行)的更多相关文章
- apache airflow docker 运行简单试用
airflow 是一个编排.调度和监控workflow的平台,由Airbnb开源,现在在Apache Software Foundation 孵化. airflow 将workflow编排为tasks ...
- springboot+nginx+https+linux实现负载均衡加域名访问简单测试
把springboot项目打包成三个jar包,并指定端口为 14341,14342,14343 下载腾讯云免费ssl证书,解压后会出现如下图文件夹 把nginx文件夹下的 .crt 和 .key文件复 ...
- Docker安装canal、mysql进行简单测试与实现redis和mysql缓存一致性
一.简介 canal [kə'næl],译意为水道/管道/沟渠,主要用途是基于 MySQL 数据库增量日志解析,提供增量数据订阅和消费. 早期阿里巴巴因为杭州和美国双机房部署,存在跨机房同步的业务需求 ...
- 在 Azure 上使用 Docker运行 Mono
Docker 是最近相当热门的一个名词,它是一个基于 Linux Container 的轻量化的虚拟技术,而微软也相当积极与 Docker 合作,在 Azure 上支持这个火热的技术,并且提供简单的方 ...
- Docker学习笔记之搭建Docker运行环境
0x00 概述 既然 Docker 是一款实用软件,我们就不得不先从它的安装说起,只有让 Docker 运行在我们的计算机上,才能更方便我们对 Docker 相关知识和使用方式的学习.得益于与商业性的 ...
- 使用Docker运行Java Web应用
前言 Tomcat是目前比较流行的Web应用服务器,深受Java爱好者的喜爱.通常J2EE应用的产出物是一个war包,这篇文章将为你介绍如何使用Docker运行Tomcat+war包的Java Web ...
- Docker运行GUI软件的方法
转自 https://www.csdn.net/article/2015-07-30/2825340 简介: Docker通过namespace将容器与主机上的网络和运行环境进行了隔离,默认情况下,在 ...
- Docker运行MongoDB及Redis及ssh端口映射远程连接
Docker运行MongoDB及Redis及ssh端口映射远程连接 本节内容简介 在本实验里我们将通过完成 MongoDB 和 Redis 两个容器来学习Dockerfile及Docker的运行机制. ...
- Docker运行 Mono
Docker运行 Mono Docker 是最近相当热门的一个名词,它是一个基于 Linux Container 的轻量化的虚拟技术,而微软也相当积极与 Docker 合作,在 Azure 上支持这个 ...
随机推荐
- Greedy Subsequences CodeForces - 1132G
我们从右往左滑动区间, 假设dp[i]表示i为左端点时的最大长度, 通过观察可以发现, 每添加一个点, 该点$dp$值=它右侧第一个比它大位置处$dp$值+1, 但是每删除一个点会将所有以它为根的$d ...
- oracle EBS grant 您不具有执行当前操作的足够权限。请与您的系统管理员联系。
解决方式1: Set the profiles of the below three to 'None' 设置以下三个配置文件为无 FND_VALIDATION_LEVELFND 验证层 FND_FU ...
- 快照库MV不能成功刷新问题的解决
前几天,一个用户找到我,说他们的物化视图不能刷新了,这得从几天前主库的一次意外down机说起(另文说明),前几天,用户现场的一个中心库因某原因意外down掉了,当时短期内对中心库进行了重启修复,没有造 ...
- JVM笔记(二) 垃圾收集器(1)
垃圾收集器 主要通过阅读<深入了解Java虚拟机>(周志明 著)和网络资源汇集而成,为本人学习JVM的笔记.同时,本文理论基于JDK 1.7版本,暂不考虑 1.8和1.9 的新特性,但可能 ...
- 060——VUE中vue-router之路由嵌套在文章系统中的使用方法:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- bzoj1002
题解: f[i]=(f[i-1]*3+f[i-2]); 高精度计算 代码: #include<bits/stdc++.h> using namespace std; struct big ...
- ORA-01034:Oracle not available
ORA-01034:Oracle not available 问题描述:ora-01034常与ora-27101同时出现,都是在登录数据库的时候报该错误 错误原因:出现ORA-01034和ORA-27 ...
- 未能加载文件或程序集“Microsoft.Office.Interop.Excel
解决方法:未能加载文件或程序集“Microsoft.Office.Interop.Excel...” 2010-07-25 08:06:15 来源:源码之家 站长整理 [大 中 小] ...
- 将本地的一个新项目上传到GitHub上新建的仓库中去
转载: 如何将本地的一个新项目上传到GitHub上新建的仓库中去 踩过的坑: 1.在git push时报错 error: RPC failed; curl 56 SSL read: error:000 ...
- L220
He must not allow this unusual barrier (obstacle) to stop him from fighting against the enemy.他绝不能让这 ...