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

Dnsmasq: Forward DNS queries to a particular DNS server #6082

Closed
stephdl opened this issue Mar 9, 2020 · 5 comments
Closed

Dnsmasq: Forward DNS queries to a particular DNS server #6082

stephdl opened this issue Mar 9, 2020 · 5 comments
Labels
verified All test cases were verified successfully

Comments

@stephdl
Copy link

stephdl commented Mar 9, 2020

For some specific reasons (testing, specific configuration....) we could specify a custom DNS server for a domain name

Proposed solution

For example I would like to direct all queries for domain.org to an IP, lets say 192.168.1.1, but I would like to have a specific sub.domain redirected to the relevant DNS server of the domain name.

so

domain.org forwarded to 192.168.1.1
sub.domain.org forwarded to the real DNS Server


thank @gsanchietti

@stephdl stephdl changed the title Dnsmasq: Forward dns queries to a particular dns server Dnsmasq: Forward dns queries to a particular DNS server Mar 9, 2020
@stephdl stephdl changed the title Dnsmasq: Forward dns queries to a particular DNS server Dnsmasq: Forward DNS queries to a particular DNS server Mar 9, 2020
stephdl added a commit to NethServer/nethserver-dnsmasq that referenced this issue Mar 9, 2020
@nethbot
Copy link
Member

nethbot commented Mar 9, 2020

in 7.7.1908/testing:

@stephdl
Copy link
Author

stephdl commented Mar 9, 2020

QA

use dnsmasq to redirect dns queries to another dns server

config setprop dnsmasq DomainRedirection domain.org:1.1.1.1,sub.domain.org:#
signal-event nethserver-dnsmasq-save

all queries for domain.org must be sent to 1.1.1.1, the queries for sub.domain.org must be sent to the default DNS server

check in /var/log/messages:

Mar  9 18:05:42 prometheus dnsmasq[28074]: using standard nameservers for domain sub.domain.org
Mar  9 18:05:42 prometheus dnsmasq[28074]: using nameserver 1.1.1.1#53 for domain domain.org

@stephdl stephdl added the testing Packages are available from testing repositories label Mar 9, 2020
@stephdl stephdl added this to ✋ Needs review in NethServer 7 via automation Mar 9, 2020
@stephdl stephdl moved this from ✋ Needs review to ⚙ Developing in NethServer 7 Mar 9, 2020
@filippocarletti
Copy link
Member

config setprop dnsmasq DomainRedirection nethesis.it:1.1.1.1,www.nethesis.it:#
[root@ns7 ~]# grep ^server /etc/dnsmasq.conf 
server=192.168.122.1
server=/nethesis.it/1.1.1.1
server=/www.nethesis.it/#
[root@ns7 ~]# ping nethesis.it
12:06:19.196044 IP 192.168.122.226.12623 > 1.1.1.1.53: 49116+ A? nethesis.it. (29)
12:06:19.214864 IP 1.1.1.1.53 > 192.168.122.226.12623: 49116 1/0/0 A 185.197.130.82 (56)
[root@ns7 ~]# ping my.nethesis.it
12:06:28.473216 IP 192.168.122.226.44776 > 1.1.1.1.53: 36008+ A? my.nethesis.it. (32)
12:06:28.494647 IP 1.1.1.1.53 > 192.168.122.226.44776: 36008 1/0/0 A 188.166.58.97 (62)
[root@ns7 ~]# ping -c 1 www.nethesis.it
12:10:51.566988 IP 192.168.122.226.39999 > 192.168.122.1.53: 12414+ A? www.nethesis.it. (33)
12:10:51.592014 IP 192.168.122.1.53 > 192.168.122.226.39999: 12414 1/0/0 A 185.197.130.82 (49)
[root@ns7 ~]# ping -c 1 google.it
12:06:53.712089 IP 192.168.122.226.60295 > 192.168.122.1.53: 8880+ A? google.it. (27)
12:06:53.742167 IP 192.168.122.1.53 > 192.168.122.226.60295: 8880 1/0/0 A 216.58.198.3 (43)

@filippocarletti filippocarletti added verified All test cases were verified successfully and removed testing Packages are available from testing repositories labels Mar 10, 2020
@filippocarletti filippocarletti removed their assignment Mar 10, 2020
gsanchietti added a commit to NethServer/docs that referenced this issue Mar 10, 2020
NethServer/dev#6082

Co-authored-by: Filippo Carletti <filippo.carletti@gmail.com>
@nethbot
Copy link
Member

nethbot commented Mar 10, 2020

in 7.7.1908/updates:

NethServer 7 automation moved this from ⚙ Developing to 🗑 Done Mar 10, 2020
@stephdl
Copy link
Author

stephdl commented Mar 10, 2020

@filippocarletti just my personal culture where did you find the log trace

[root@ns7 ~]# ping -c 1 google.it
12:06:53.712089 IP 192.168.122.226.60295 > 192.168.122.1.53: 8880+ A? google.it. (27)
12:06:53.742167 IP 192.168.122.1.53 > 192.168.122.226.60295: 8880 1/0/0 A 216.58.198.3 (43)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
verified All test cases were verified successfully
Projects
No open projects
NethServer 7
🗑 Done
Development

No branches or pull requests

4 participants