From 7eec3859fad1e9a94e624f9a53ea261c821513b8 Mon Sep 17 00:00:00 2001 From: Arne Welzel Date: Wed, 5 Mar 2025 12:35:17 +0100 Subject: [PATCH] btest/dns_mgr: Update run-dnsmasq, use --host-record Using dnsmasq --address covers an entire domain, so dns.example.com AAAA queries would also return IPv6 addresses for example.com Instead, this was always meant to use host entries. --- .../Baseline/dns_mgr.lookup_hostname_cname/out | 7 ++++++- testing/btest/dns_mgr/lookup_hostname_cname.zeek | 4 ++-- testing/scripts/run-dnsmasq | 15 +++++++-------- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/testing/btest/Baseline/dns_mgr.lookup_hostname_cname/out b/testing/btest/Baseline/dns_mgr.lookup_hostname_cname/out index 5711a95433..bfb9f7f914 100644 --- a/testing/btest/Baseline/dns_mgr.lookup_hostname_cname/out +++ b/testing/btest/Baseline/dns_mgr.lookup_hostname_cname/out @@ -1,3 +1,8 @@ ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. -lookup_hostname addrs, 0 +lookup_hostname addrs, 5 +10.0.0.3 +10.0.0.2 +10.0.0.1 +fe80::6990:df6e:618:c096 +10.0.0.4 lookup_hostname_txt, 15, www.example.com diff --git a/testing/btest/dns_mgr/lookup_hostname_cname.zeek b/testing/btest/dns_mgr/lookup_hostname_cname.zeek index 0c66df4043..8ed91dc2a6 100644 --- a/testing/btest/dns_mgr/lookup_hostname_cname.zeek +++ b/testing/btest/dns_mgr/lookup_hostname_cname.zeek @@ -13,8 +13,8 @@ redef exit_only_after_terminate = T; event zeek_init() { - # www.example.com is a CNAME for example.com and this - # results in nothing :-/ + # www.example.com is a CNAME for example.com, we get all + # addresses of example.com when ( local addrs = lookup_hostname("www.example.com") ) { print "lookup_hostname addrs", |addrs|; diff --git a/testing/scripts/run-dnsmasq b/testing/scripts/run-dnsmasq index edada1b6e5..c5ca48a438 100755 --- a/testing/scripts/run-dnsmasq +++ b/testing/scripts/run-dnsmasq @@ -19,14 +19,13 @@ exec dnsmasq \ --no-daemon \ --listen-addr="${listen_addr}" \ --port="${listen_port}" \ - --address /example.com/10.0.0.1 \ - --address /example.com/10.0.0.2 \ - --address /example.com/10.0.0.3 \ - --address /example.com/10.0.0.4 \ - --address /example.com/10.0.0.4 \ - --address /example.com/fe80::6990:df6e:618:c096 \ - --address /mx.example.com/10.0.0.99 \ - --address /dns.example.com/10.0.0.99 \ + --host-record=example.com,10.0.0.1 \ + --host-record=example.com,10.0.0.2 \ + --host-record=example.com,10.0.0.3 \ + --host-record=example.com,10.0.0.4 \ + --host-record=example.com,fe80::6990:df6e:618:c096 \ + --host-record=mx.example.com,10.0.0.99 \ + --host-record=dns.example.com,10.0.0.99 \ --ptr-record=99.0.0.10.in-addr.arpa,mx.example.com \ --ptr-record=99.0.0.10.in-addr.arpa,dns.example.com \ --txt-record=example.com,network-monitor,open-source,zeek \