Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DNS负载均衡,客户端无效 #19

Open
myml opened this issue Oct 10, 2018 · 0 comments
Open

DNS负载均衡,客户端无效 #19

myml opened this issue Oct 10, 2018 · 0 comments
Labels

Comments

@myml
Copy link
Owner

myml commented Oct 10, 2018

dns同一A记录指向不同IP,可实现简单的dns负载均衡,最近发现在linux上用ping总返回同一个IP,原因是为了支持IPv6,新版本glibc新增getaddrinfo函数,用来替代gethostbyname进行域名IP查询。getaddrinfo会依照rfc3484对IP进行排序。简单的解决办法是禁用IPv6

echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6
echo net.ipv6.conf.all.disable_ipv6 = 1 >> /etc/sysctl.conf
@myml myml added the net label Apr 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant