引用本文请注明出处:Just Do IT (http://www.toplee.com) < Michael Lee @ toplee.com >
前几天服务器更换了电信的ip和dns之后,速度有了很大提高,系统发信的速度也基本达到了正常可以接受的水平,但是如果要应付大量的邮件列表功能,还是感觉有些吃力,于是考虑进一步提高dns解析速度,因为sendmail响应慢很大程度跟dns反向解析解析有关,在网上查了很多资料都提到受sendmail发信慢的困扰,但是都没有看到好的解决办法。
偶然间从freebsd的ports/dns/下看到了djbdns这个包,一查资料发现有个dnscache功能,于是决定一试,没想效果出奇的好,非常值得推荐给大家!
下面是我安装过程,和大家分享!
全部都是使用root用户操作下面的命令!
[coolcode]
#cd /usr/ports/dns/djbdns
#make install clean
#mkdir /var/service
#csh (或者exit退出再登陆,或者运行bash也可以)
#dnscache-conf nobody nobody /var/service/dnscache 127.0.0.1
#vi /etc/rc.conf 里加入 svscan_enable=”YES”
#/usr/local/etc/rc.d/svscan.sh start 启动服务,完成安装
下面检查服务启动情况
#netstat -anl |grep LISTEN
看看里面是否有53端口的监听服务,如果有就ok了
接着修改/etc/reslove.conf文件,把127.0.0.1加入到第一行,如下
nameserver 127.0.0.1
nameserver xx.xx.xx.xx (其他的公网dns)
这时测试一下效果
dig www.sina.com.cn
你会发现可能第一次稍微时间长一点,第二次反应时间都基本是0.000msec或者0.001msec,这就是取到了本地的缓存,效果好得不行!
[/coolcode]
接着测试了sendmail的大量并发发信,结果非常的喜人,完全能满足中等网站的并发业务处理了,朋友们可以自己测试一下:)
djbdns其他的功能我还没有研究到,欢迎大家和我一起学习和交流!
用BIND可以吗?
bind也是可以的,届时设置您的reslove.conf文件,把nameserver第一个设置为您的bind地址,bind相对复杂一些,在缓存方面没有djbdns轻量级和高效。
对外查询是在本地打开随机的UDP端口连接外部的53端口吗?如果是,IPFW的规则要怎么写?
往外连接你还需要限制? 你可以指定协议UDP到 target的port是53的都开放,具体书写语句看ipfw的man吧。理论上这个规则是默认都会打开的,要不你的机器怎么做dns解析.
怎么才可以清空dnscache的缓存呢?找了好久,没找到办法.
最笨的办法: 删除目录,dnscache-conf重建一下
Thank you!
Thanks for sharing your thoughts on domanda di visto.
Regards
Wow, fantastic blog layout! How long have you been blogging for?
you made blogging look easy. The overall look of your web
site is magnificent, let alone the content!
Hi there! I simply would like to give you a big thumbs up for your great information you’ve got
here on this post. I am returning to your site for more soon.
First off I want to say excellent blog! I had a quick question in which
I’d like to ask if you do not mind. I was curious to know how you center yourself and clear your thoughts prior
to writing. I’ve had difficulty clearing my mind in getting
my thoughts out. I truly do take pleasure in writing however it just seems like the first 10 to 15 minutes are generally wasted simply just trying to
figure out how to begin. Any suggestions or hints?
Thanks!
I’ve been surfing online more than 4 hours today, yet I never found any interesting article like
yours. It is pretty worth enough for me. In my view, if all site
owners and bloggers made good content as you did, the net will be
a lot more useful than ever before.
Right now it appears like BlogEngine is the preferred blogging platform out
there right now. (from what I’ve read) Is that what you’re using on your blog?
I’ll immediately clutch your rss feed as I can not
to find your email subscription link or newsletter service.
Do you have any? Kindly allow me understand in order that I may just subscribe.
Thanks.
It’s perfect time to make a few plans for the long run and it is time to
be happy. I have read this submit and if I may I desire to
suggest you few fascinating issues or suggestions.
Maybe you can write next articles regarding this article.
I desire to learn even more things about it!
Right now it seems like Drupal is the top blogging platform available right now.
(from what I’ve read) Is that what you’re using on your blog?
Just desire to say your article is as astonishing. The clearness to your post is just excellent and that
i can think you are a professional in this subject. Well along with your permission let
me to take hold of your RSS feed to stay updated
with approaching post. Thanks 1,000,000 and please continue the enjoyable work.
I’m not sure exactly why but this site is loading very slow
for me. Is anyone else having this problem
or is it a issue on my end? I’ll check back later and see if
the problem still exists.
Hmm is anyone else encountering problems with the images on this blog loading?
I’m trying to determine if its a problem on my end or if it’s the blog.
Any suggestions would be greatly appreciated.
I simply could not leave your web site prior to suggesting that I really enjoyed the standard info an individual provide for your guests?
Is going to be again frequently in order to inspect
new posts
Hello this is kinda of off topic but I was wanting to know if blogs use WYSIWYG editors
or if you have to manually code with HTML.
I’m starting a blog soon but have no coding knowledge so I wanted to
get advice from someone with experience. Any help would be
enormously appreciated!
Wow, wonderful weblog format! How long have you been blogging for?
you made blogging look easy. The total look of your site is wonderful,
let alone the content material!
An intriguing discussion is definitely worth comment.
I do believe that you ought to write more on this issue, it might not be a taboo subject but usually people don’t talk about these issues.
To the next! All the best!!