/ etc / hosts 파일과 함께 라운드 로빈 DNS를 사용할 수 있습니까?


13

에 다음 구성으로 라운드 로빈 DNS를 사용할 수 /etc/hosts있습니까?

192.168.4.10 shaakunthala.local
192.168.4.20 shaakunthala.local

저는 Linux에 있습니다.

답변:


9

dnsmasq, 라운드 로빈 DNS 제공

> egrep -m1 '^nameserver' /etc/resolv.conf
nameserver 127.0.0.1
> grep -i rrtest /etc/hosts
1.1.1.1 rrtest
2.2.2.2 rrtest
> /etc/init.d/dnsmasq restart 
Shutting down dnsmasq:                                     [  OK  ]
Starting dnsmasq:                                          [  OK  ]
> nslookup rrtest 
Server:         127.0.0.1
Address:        127.0.0.1#53

Name:   rrtest
Address: 2.2.2.2
Name:   rrtest
Address: 1.1.1.1

> nslookup rrtest 
Server:         127.0.0.1
Address:        127.0.0.1#53

Name:   rrtest
Address: 1.1.1.1
Name:   rrtest
Address: 2.2.2.2

1
dnsmasq는 와일드 카드 dns 또는 RR dns 만 아카이브 할 수 있습니다. 두 기능이 모두 필요한 경우 bind9를 사용할 수 있습니다.
okwap

8

아니요, 작동하지 않습니다.

또한 / etc / hosts는 DNS가 대체 할 기본 형식의 이름-> 주소 매핑입니다. 라운드 로빈 DNS를 원하는 경우 DNS 서버를 설치하십시오.

당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.