DNSMasq - Exclude some subdomains

We've got several machines set up with DNSMasq to run local development environments forwarding all .dev requests to 127.0.0.1

However we need to add some exclusions to this list, wondering how we'd go about it.

All these exclusions are still internal IP addresses, which are resolved by an internal DNS server, say on 192.168.1.255

For example we'd want to exclude any subomain or domain that has batcave.dev in it.

So batcave.dev would use the dns server on 192.168.1.255 and resolve to what ever is setup in the DNS server, along with other entries like wiki.batcave.dev and phpmyadmin.batcave.dev there could be any number of these subdomains.

We're running OSX/macOS & currently our resolver file from /private/etc/resolver/dev has just nameserver 127.0.0.1 in it.

Then our /usr/local/etc/dnsmasq.conf has this added to the bottom

address=/.dev/127.0.0.1
listen-address=127.0.0.1
port=35353

You can see the full files at https://gist.github.com/OwenMelbz/80c68e836058959b87f86f242e6efffa if needed :)

1
задан 18 June 2017 в 12:48
1 ответ

Если я правильно понял ваш вопрос, то вам нужна опция -S в командной строке:

    This is intended for private nameservers:
    if you have a nameserver on your network which deals with
    names of the form xxx.internal.thekelleys.org.uk at
    192.168.1.1 then giving the flag
    -S /internal.thekelleys.org.uk/192.168.1.1
    will send all queries for internal machines to
    that nameserver, everything else will go to
    the servers in /etc/resolv.conf.

Тогда, в вашем случае это World будет чем-то вроде

    -S /batcave.dev/192.168.1.255

или в файле конфигурации

    server=/batcave.dev/192.168.1.255

Надеюсь, это поможет!

2
ответ дан 3 December 2019 в 20:21

Теги

Похожие вопросы