2

So I have been trying to set up my own DCHP and DNS servers on my old 2012 Mac Mini running Ubuntu Server 22.04. The Bind9 is running on a docker container with this compose file:

version: "3" 

services:
  bind9:
    container_name: dnss
    image: ubuntu/bind9:latest
    environment:
      - BIND9_USER=root
      - TZ=America/Los_Angeles
    ports:
      - "53:53/tcp"
      - "53:53/udp"
      - "953:953/tcp"
      - "953:953/udp"
    volumes:
      - ./config:/etc/bind
      - ./cache:/var/cache/bind
      - ./records:/var/lib/bind
    restart: unless-stopped

Then this is my named.conf

options {
    forwarders {
        8.8.4.4;
        8.8.8.8;
    };  
    allow-query { any; };
    query-source address * port *;

};

I then have the DHCP server running directly on the machine. With this configuration:

subnet 192.168.0.0 netmask 255.255.255.0 {
  range 192.168.0.100 192.168.0.200;
  option domain-name-servers 8.8.8.8;
  option subnet-mask 255.255.255.0;
  option routers 192.168.0.1;
  option broadcast-address 192.168.0.255;
  default-lease-time 600;
  max-lease-time 7200;
}

At first, I couldn't get the DCHP server working but then I found that I needed to give my network interface a static ip address and so I modified my Netplan .yaml as follows:

network:
  renderer: networkd
  ethernets:
    enp2s0f0:
      dhcp4: false
      addresses:
        - 192.168.0.99/24
      routes:
        - to: default
          via: 192.168.0.1
      dhcp6: false
  version: 2

So now the DHCP server is working fine (I think, so far I have not seen any errors) and all my devices on my router are getting an ip address. I have also turned off the DHCP service on my router and any firewall on my Mac Mini. But for some reason, I keep getting this error:

homeuser@dnsserver:~/DNSServer$ nslookup google.com 127.0.0.1
Server:     127.0.0.1
Address:    127.0.0.1#53

** server can't find google.com: SERVFAIL

This is my first time doing this and I've been stuck on it for a couple of days now. I'm not sure what the problem is.

1
  • 1
    Have you checked the Bind9 server's log files to see what they say about the problem? Mar 11, 2023 at 9:02

0

You must log in to answer this question.

Browse other questions tagged .