Dnsmasq не выдает второй DNS

Dnsmasq версии 2.79 в MacOS 10.12.6 с использованием Homebrew. Это моя конфигурация dnsmasq:

# Never forward plain names (without a dot or domain part)
domain-needed

# Never forward addresses in the non-routed address spaces.
bogus-priv

# If you want dnsmasq to listen for DHCP and DNS requests only on
# specified interfaces (and the loopback) give the name of the
# interface (eg eth0) here.
# Repeat the line for more than one interface.
interface=en4

# Always allocate the host with Ethernet address 11:22:33:44:55:66
# The IP address 192.168.0.60

<bunch of hosts>


# Do the same thing, but using the option name
dhcp-option=option:router,192.168.2.1
dhcp-option=option:ntp-server,192.168.2.1
dhcp-option=6,192.168.2.1,8.8.8.8,8.8.4.4

# Log lots of extra information about DHCP transactions.
log-dhcp

Важная часть - это параметры. Я пытаюсь добиться, чтобы мои DHCP-клиенты настроили три DNS-сервера: 192.168.2.1 и два сервера Google. Однако вот что я получаю, когда обнюхиваю DHCP-трафик, исходящий от этого сервера:

---------------------------------------------------------------------------

  TIME: 2018-05-21 17:40:37.454
    IP: 192.168.2.1 (f6:5c:89:ca:e0:64) > 192.168.2.30 (0:50:b6:22:8e:6e)
    OP: 2 (BOOTPREPLY)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: 80916f1c
  SECS: 0
 FLAGS: 0
CIADDR: 0.0.0.0
YIADDR: 192.168.2.30
SIADDR: 192.168.2.1
GIADDR: 0.0.0.0
CHADDR: 00:50:b6:22:8e:6e:00:00:00:00:00:00:00:00:00:00
 SNAME: .
 FNAME: .
OPTION:  53 (  1) DHCP message type         5 (DHCPACK)
OPTION:  54 (  4) Server identifier         192.168.2.1
OPTION:  51 (  4) IP address leasetime      43200 (12h)
OPTION:  58 (  4) T1                        21600 (6h)
OPTION:  59 (  4) T2                        37800 (10h30m)
OPTION:   1 (  4) Subnet mask               255.255.255.0
OPTION:  28 (  4) Broadcast address         192.168.2.255
OPTION:   3 (  4) Routers                   192.168.2.1
OPTION:   6 (  4) DNS server                192.168.2.1
OPTION:  12 (  8) Host name                 aimdroid
OPTION:  42 (  4) NTP servers               192.168.2.1
---------------------------------------------------------------------------

Сообщается только об одном DNS-сервере. Что здесь не так?

2
задан 23 May 2018 в 12:51
1 ответ

Это работает для pi-hole (на основе dnsmasq, должна быть точно такая же конфигурация):

dhcp-option=option:dns-server,10.0.0.5,10.0.0.10

не уверен, почему ваш пример не работает - кажется правильным. Вы пробовали использовать только 2 IP-адреса серверов вместо 3?

1
ответ дан 10 January 2021 в 19:35

Теги

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