frp内网穿透基本用法

实现智能dns为用户分配最佳线路

妙音 posted @ 2019年3月24日 09:43 in network with tags 智能dns , 2407 阅读
 

说明

 
服务器放在国外,不同线路质量不一样。如何根据访问者的所在地、运营商,智能的分配线路呢?
 
有些域名服务器上提供线路优先级,比如阿里云,如果是国外域名服务商,一般都不会提供。
 
所以通常要我们自己实现自动分配线路的功能。
 
 

例如

 
有一个网站www.yongqingking.top,它的真实服务器ServerA在海外。网站的部分用户在国内。
由于各种原因,在国内访问海外服务器的质量不是很好。为了改善状态,打算为国内用户提供多条访问线路。
 
用户访问时,自动分配合适线路,提供网站访问质量。
 
 

待解决问题

 
要解决上面问题,需要解决下面几个问题
 
1.如何实现多条访问线路?
 
2.如何自动分配线路?
 
3.如何知道线路质量最好?
 
 

如何实现多条访问线路?--端口映射

 
在合适的地区新建节点NodeA,将NodeA的80端口转发给ServerA的80端口。
 
firewall-cmd --add-forward-port=port=80:proto=tcp:toaddr=ServerA的ip:toport=80  --permanent
 

如何自动分配线路?--bind视图

 
1.分配给用户合适的节点ip就等于分配了线路。
 
2.分配ip是dns干的事情,我们必须要弄个自己的dns服务器。
 
3.dns服务器有很多,我们可以自己写一个,也可以用dnsmasq,chinadns,smartdns等,但是都不适合
 
4.最终我选择的是bind,比较常用的一个dns服务器,利用它的视图功能
 
  • 安装
 
yum install bind
 
  • 修改配置允许外部访问
 
options {
        listen-on port 53 { 127.0.0.1; 主机ip;};
        allow-query     { any;};
}
 
  • 配置acl+视图
 
介绍bind视图的文章很多
 
 
  • 定制bind视图
 
开发功能接口修改bind视图,并且bind支持热加载,不需要重启
 
 

如何知道线路质量呢?--反向扫描

 
1.通常的方法是,在各个地区布置探测节点。付出成本太高,不现实。
 
2.借助第三方的服务,例如站长工具等。
 
3.系统中记录了访问者ip,在节点上ping所有ip或扫描端口
 
定时扫描线路质量,然后再更新dns配置。
 

来源

 
 
Avatar_small
SaaS Security Postur 说:
2020年12月14日 15:20

You know your projects stand out of the herd. There is something special about them. It seems to me all of them are really brilliant!

Avatar_small
CSPM for SaaS 说:
2020年12月14日 15:20

Very useful post. This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. Really its great article. Keep it up.

Avatar_small
Pak24tv 说:
2021年1月22日 14:02

I am happy to find your distinguished way of writing the post. Now you make it easy for me to understand and implement the concept. Thank you for the post. names to call your girlfriend girl name start with c guy names middle name

Avatar_small
Digital_Zone 说:
2021年2月20日 16:49

I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article. Airco Heers

Avatar_small
Digital_Zone 说:
2021年2月20日 16:56

Keep up the good work , I read few posts on this web site and I conceive that your blog is very interesting and has sets of fantastic information. Zonnepanelen Maastricht

Avatar_small
Digital_Zone 说:
2021年2月20日 17:01

Impressive web site, Distinguished feedback that I can tackle. Im moving forward and may apply to my current job as a pet sitter, which is very enjoyable, but I need to additional expand. Regards. Airco Herk-de-Stad

Avatar_small
Digital_Zone 说:
2021年2月20日 17:05

Thanks for your post. I’ve been thinking about writing a very comparable post over the last couple of weeks, I’ll probably keep it short and sweet and link to this instead if thats cool. Thanks. Zonnepanelen Meerssen

Avatar_small
Digital_Zone 说:
2021年2月20日 17:09

I have been impressed after read this because of some quality work and informative thoughts. I just want to say thanks for the writer and wish you all the best for coming! Your exuberance is refreshing. Airco Herstappe

Avatar_small
Digital_Zone 说:
2021年2月20日 17:13

Nice post. I was checking constantly this blog and I am impressed! Extremely helpful information specially the last part I care for such info a lot. I was seeking this particular information for a very long time. Thank you and good luck. Zonnepanelen Mook en Middelaar

Avatar_small
Digital_Zone 说:
2021年2月20日 17:17

It is included in my habit that I often visit blogs in my free time, so after landing on your blog. I have thoroughly impressed with it and decided to take out some precious time to visit it again and again. Thanks. Airco Heusden

Avatar_small
Digital_Zone 说:
2021年2月20日 17:31

Efficiently written information. It will be profitable to anybody who utilizes it, counting me. Keep up the good work. For certain I will review out more posts day in and day out. Zonnepanelen Nederweert

Avatar_small
Digital_Zone 说:
2021年2月20日 17:36

Great post but I was wondering if you could write a little more on this subject? I’d be very thankful if you could elaborate a little bit further. Thanks in advance! Airco Hoeselt

Avatar_small
Digital_Zone 说:
2021年2月20日 17:40

This is a great inspiring article.I am pretty much pleased with your good work.You put really very helpful information. Keep it up. Keep blogging. Looking to reading your next post. Zonnepanelen Peel en Maas

Avatar_small
Digital_Zone 说:
2021年2月20日 17:45

Awesome article! I want people to know just how good this information is in your article. It’s interesting, compelling content. Your views are much like my own concerning this subject. Airco Houthalen

Avatar_small
Digital_Zone 说:
2021年2月20日 17:49

Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with extra information? It is extremely helpful for me. Zonnepanelen Roerdalen

Avatar_small
Digital_Zone 说:
2021年2月20日 17:55

Great job for publishing such a beneficial web site. Your web log isn’t only useful but it is additionally really creative too. There tend to be not many people who can certainly write not so simple posts that artistically. Continue the nice writing Airco Helchteren

Avatar_small
Digital_Zone 说:
2021年2月20日 18:09

I know this is one of the most meaningful information for me. And I'm animated reading your article. But should remark on some general things, the website style is perfect; the articles are great. Thanks for the ton of tangible and attainable help. Zonnepanelen Roermond

Avatar_small
Digital_Zone 说:
2021年2月20日 18:13

All the contents you mentioned in post is too good and can be very useful. I will keep it in mind, thanks for sharing the information keep updating, looking forward for more posts.Thanks Airco Lanaken

Avatar_small
Digital_Zone 说:
2021年2月20日 18:17

Keep up the good work , I read few posts on this web site and I conceive that your blog is very interesting and has sets of fantastic information. Zonnepanelen Simpelveld

Avatar_small
Digital_Zone 说:
2021年2月20日 18:20

Positive site, where did u come up with the information on this posting?I have read a few of the articles on your website now, and I really like your style. Thanks a million and please keep up the effective work. Airco Leopoldsburg

Avatar_small
Digital_Zone 说:
2021年2月20日 18:24

Yes i am totally agreed with this article and i just want say that this article is very nice and very informative article.I will make sure to be reading your blog more. You made a good point but I can't help but wonder, what about the other side? !!!!!!Thanks Zonnepanelen SittardGeleen

Avatar_small
Digital_Zone 说:
2021年2月20日 18:28

Thanks a lot for sharing this excellent info! I am looking forward to seeing more posts by you as soon as possible! I have judged that you do not compromise on quality. Airco Kortessem

Avatar_small
Digital_Zone 说:
2021年2月20日 19:15

Really I enjoy your site with effective and useful information. It is included very nice post with a lot of our resources.thanks for share. i enjoy this post. Zonnepanelen Stein

Avatar_small
Digital_Zone 说:
2021年2月20日 19:23

Interesting topic for a blog. I have been searching the Internet for fun and came upon your website. Fabulous post. Thanks a ton for sharing your knowledge! It is great to see that some people still put in an effort into managing their websites. I'll be sure to check back again real soon. Airco Lummen

Avatar_small
Digital_Zone 说:
2021年2月20日 19:27

It is a good site post without fail. Not too many people would actually, the way you just did. I am impressed that there is so much information about this subject that has been uncovered and you’ve defeated yourself this time, with so much quality. Good Works! Zonnepanelen Vaals

Avatar_small
Digital_Zone 说:
2021年2月20日 19:31

Pretty good post. I have just stumbled upon your blog and enjoyed reading your blog posts very much. I am looking for new posts to get more precious info. Big thanks for the useful info. Airco Maasmechelen

Avatar_small
Digital_Zone 说:
2021年2月20日 19:35

I have seen some great stuff here. Worth bookmarking for revisiting. I surprise how much effort you put to create such a great informative website. Your work is truly appreciated around the clock and the globe. Zonnepanelen Valkenburg aan de Geul

Avatar_small
Digital_Zone 说:
2021年2月20日 19:41

Wow, cool post. I’d like to write like this too – taking time and real hard work to make a great article… but I put things off too much and never seem to get started. Thanks though. Airco Zolder

Avatar_small
Digital_Zone 说:
2021年2月20日 19:45

Excellent website! I adore how it is easy on my eyes it is. I am questioning how I might be notified whenever a new post has been made. Looking for more new updates. Have a great day! Zonnepanelen Venlo

Avatar_small
Digital_Zone 说:
2021年2月26日 05:33 That is the excellent mindset, nonetheless is just not help to make every sence whatsoever preaching about that mather. Virtually any method many thanks in addition to i had endeavor to promote your own article in to delicius nevertheless it is apparently a dilemma using your information sites can you please recheck the idea. thanks once more. paayi tech
Avatar_small
Digital_Zone 说:
2021年2月28日 04:10

Remarkable article, it is particularly useful! I quietly began in this, and I'm becoming more acquainted with it better! Delights, keep doing more and extra impressive! dominoqq

Avatar_small
wikipedia 说:
2021年2月28日 18:34

I am hoping the same best effort from you in the future as well. In fact your creative writing skills has inspired me.

Avatar_small
Dr. Natale 说:
2021年2月28日 18:37

This is such a great resource that you are providing and you give it away for free. I love seeing websites that understand the value of providing a quality resource for free. It is the old what goes around comes around routine.

Avatar_small
Digital_Zone 说:
2021年3月12日 06:45

You have performed a great job on this article. It’s very precise and highly qualitative. You have even managed to make it readable and easy to read. You have some real writing talent. Thank you so much. 토토사이트

Avatar_small
Digital_Zone 说:
2021年3月12日 06:52

Thanks for the blog filled with so many information. Stopping by your blog helped me to get what I was looking for. Now my task has become as easy as ABC. dismiss speeding ticket in texas

Avatar_small
Digital_Zone 说:
2021年3月12日 06:58

Believe it or not, it is the type of information I’ve long been trying to find. It matches to my requirements a lot. Thank you for writing this information. roper cowboy buckles

Avatar_small
Digital_Zone 说:
2021年3月12日 07:04

Impressive web site, Distinguished feedback that I can tackle. Im moving forward and may apply to my current job as a pet sitter, which is very enjoyable, but I need to additional expand. Regards. austin deck company

Avatar_small
Digital_Zone 说:
2021年3月12日 07:11

I’m going to read this. I’ll be sure to come back. thanks for sharing. and also This article gives the light in which we can observe the reality. this is very nice one and gives indepth information. thanks for this nice article... storage container rentals

Avatar_small
Digital_Zone 说:
2021年3月12日 07:16

Yes, I am entirely agreed with this article, and I just want say that this article is very helpful and enlightening. I also have some precious piece of concerned info !!!!!!Thanks. acheter des abonnés

Avatar_small
Digital_Zone 说:
2021年3月12日 07:24

Wow, excellent post. I'd like to draft like this too - taking time and real hard work to make a great article. This post has encouraged me to write some posts that I am going to write soon. marriage and family therapist

Avatar_small
Digital_Zone 说:
2021年3月12日 07:30

The content is utmost interesting! I have completely enjoyed reading your points and have come to the conclusion that you are right about many of them. You are great, and your efforts are outstanding! deck builders near me

Avatar_small
Digital_Zone 说:
2021年3月12日 07:36

Hey, this day is too much good for me, since this time I am reading this enormous informative article here at my home. Thanks a lot for massive hard work. data privacy in austin tx

Avatar_small
Digital_Zone 说:
2021年3月20日 23:40 Excellent blog! I found it while surfing around on Google. Content of this page is unique as well as well researched. Appreciate it. Lahore Call girls
Avatar_small
Digital_Zone 说:
2021年3月20日 23:45

I am constantly surprised by the amount of information accessible on this subject. What you presented was well researched and well written to get your stand on this over to all your readers. Thanks a lot my dear. Islamabad call girls

Avatar_small
Digital_Zone 说:
2021年3月20日 23:49

I was surfing the Internet for information and came across your blog. I am impressed by the information you have on this blog. It shows how well you understand this subject. Karachi Call girls

Avatar_small
Digital_Zone 说:
2021年3月20日 23:52

It is my first visit to your blog, and I am very impressed with the articles that you serve. Give adequate knowledge for me. Thank you for sharing useful material. I will be back for the more great post. Call girls in Lahore

Avatar_small
Digital_Zone 说:
2021年3月20日 23:55

Hey There. I found your blog using msn. This is a very well written article. I’ll be sure to bookmark it and come back to read more of your useful info. Thanks for the post. I’ll definitely return. Call girls in Karachi

Avatar_small
Digital_Zone 说:
2021年3月21日 04:12

This is a truly good site post. Not too many people would actually, the way you just did. I am really impressed that there is so much information about this subject that have been uncovered and you’ve done your best, with so much class. If wanted to know more about green smoke reviews, than by all means come in and check our stuff. Call girls in Islamabad

Avatar_small
dany 说:
2021年3月28日 23:35 Pretty nice post. I just stumbled upon your weblog and wanted to say that I have really enjoyed browsing your blog posts. After all I’ll be subscribing to your feed and I hope you write again soon! 123movie
Avatar_small
Digital_Zone 说:
2021年5月23日 03:17

I am thankful to you for sharing this plethora of useful information. I found this resource utmost beneficial for me. Thanks a lot for hard work. Ramen en deuren


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter