도메인 이름 기반 dnsmasq 조건부 전달

도메인 이름 기반 dnsmasq 조건부 전달

원하는 결과는 해결해야 하는 호스트 이름을 기반으로 수신한 쿼리를 전달하기 위해 dnsmasq가 필요하다는 것입니다.

  • DNS는 필요한 유일한 기능입니다. dhcp, tftp 등은 없습니다.
  • 192.168.1.2는 dnsmasq 서비스를 제공하는 머신입니다.
  • 192.168.1.7은 dnsmask를 쿼리하는 시스템입니다.
  • 192.168.1.2의 서버가 이러한 제한 사항을 준수하도록 하는 것은 관련이 없거나 필요하지 않습니다.

    예를 들어 192.168.1.7에 다음을 입력합니다.

    nslookup some.mydomain.local

10.0.1.1의 DNS 서버로 전달되어야 하고
, apple.com에 대한 요청은 8.8.8.8로 전달되어야 합니다.

내 dnsmasq 파일은 다음과 같습니다.

server=/mydomain.local/10.0.1.1
server=/mydomain.local/10.0.1.2
server=/mydomain.local/10.0.1.3
server=/mydomain.local/10.0.1.4

server=/mydomain.com/10.0.1.1
server=/mydomain.com/10.0.1.2
server=/mydomain.com/10.0.1.3
server=/mydomain.com/10.0.1.4

server=8.8.8.8
server=8.8.4.4
listen-address=0.0.0.0
bind-interfaces

그러나 로그 출력에는 내가 원하는 작업이 수행되지 않는 것으로 표시됩니다.

 mypc dnsmasq: query[PTR] 2.1.168.192.in-addr.arpa from 192.168.1.7
 mypc dnsmasq: cached 192.168.1.2 is mypc.mydomain.local
 mypc dnsmasq: query[A] apple.com.mydomain.local from 192.168.1.7
 mypc dnsmasq: forwarded apple.com.mydomain.local to 10.0.1.1
 mypc dnsmasq: forwarded apple.com.mydomain.local to 10.0.1.2
 mypc dnsmasq: forwarded apple.com.mydomain.local to 10.0.1.4
 mypc dnsmasq: forwarded apple.com.mydomain.local to 10.0.1.3
 mypc dnsmasq: reply apple.com.mydomain.local is NXDOMAIN-IPv4
 mypc dnsmasq: query[AAAA] apple.com.mydomain.local from 192.168.1.7
 mypc dnsmasq: forwarded apple.com.mydomain.local to 10.0.1.1
 mypc dnsmasq: forwarded apple.com.mydomain.local to 10.0.1.2
 mypc dnsmasq: forwarded apple.com.mydomain.local to 10.0.1.4
 mypc dnsmasq: forwarded apple.com.mydomain.local to 10.0.1.3
 mypc dnsmasq: reply apple.com.mydomain.local is NXDOMAIN-IPv6
 mypc dnsmasq: query[A] apple.com.mydomain.com from 192.168.1.7
 mypc dnsmasq: forwarded apple.com.mydomain.com to 10.0.1.1
 mypc dnsmasq: forwarded apple.com.mydomain.com to 10.0.1.2
 mypc dnsmasq: forwarded apple.com.mydomain.com to 10.0.1.4
 mypc dnsmasq: forwarded apple.com.mydomain.com to 10.0.1.3
 mypc dnsmasq: reply apple.com.mydomain.com is NXDOMAIN-IPv4
 mypc dnsmasq: query[AAAA] apple.com.mydomain.com from 192.168.1.7
 mypc dnsmasq: forwarded apple.com.mydomain.com to 10.0.1.1
 mypc dnsmasq: forwarded apple.com.mydomain.com to 10.0.1.2
 mypc dnsmasq: forwarded apple.com.mydomain.com to 10.0.1.4
 mypc dnsmasq: forwarded apple.com.mydomain.com to 10.0.1.3
 mypc dnsmasq: reply apple.com.mydomain.com is NXDOMAIN-IPv6
 mypc dnsmasq: query[A] apple.com.dc1.mydomain.com from 192.168.1.7
 mypc dnsmasq: forwarded apple.com.dc1.mydomain.com to 8.8.8.8
 mypc dnsmasq: forwarded apple.com.dc1.mydomain.com to 8.8.4.4
 mypc dnsmasq: forwarded apple.com.dc1.mydomain.com to 10.0.1.1
 mypc dnsmasq: forwarded apple.com.dc1.mydomain.com to 10.0.1.2
 mypc dnsmasq: forwarded apple.com.dc1.mydomain.com to 10.0.1.4
 mypc dnsmasq: forwarded apple.com.dc1.mydomain.com to 10.0.1.3
 mypc dnsmasq: reply apple.com.dc1.mydomain.com is NXDOMAIN-IPv4
 mypc dnsmasq: query[AAAA] apple.com.dc1.mydomain.com from 192.168.1.7
 mypc dnsmasq: forwarded apple.com.dc1.mydomain.com to 8.8.4.4
 mypc dnsmasq: reply apple.com.dc1.mydomain.com is NXDOMAIN-IPv6
 mypc dnsmasq: query[A] apple.com from 192.168.1.7
 mypc dnsmasq: forwarded apple.com to 8.8.4.4
 mypc dnsmasq: reply apple.com is 17.172.224.47
 mypc dnsmasq: reply apple.com is 17.178.96.59
 mypc dnsmasq: reply apple.com is 17.142.160.59
 mypc dnsmasq: query[AAAA] apple.com from 192.168.1.7
 mypc dnsmasq: forwarded apple.com to 8.8.4.4
 mypc dnsmasq: reply apple.com is NODATA-IPv6

아이디어?

미리 감사드립니다.

관련 정보