Ubuntu Server 20.04 installing a dhcp without internet access

I've just recently set up my Ubuntu Server 20.04 and now I'm trying to install a DHCP server.

But it always fails because I get

Temporary failure resolving 'archives.ubuntu.com'

Is there any way I can set up my network without internet access? Are there any alternatives?

Thanks in advance


You could use systemd-networkd.service to provide you with a DHCP-server, this is already installed at your Ubuntu machine.

Open a terminal and type networkctl and look for your network interface name which shall host your DHCP-server, for example eth0, after that change directory via cd /etc/systemd/network and create a network-file with a name as you like, for example via sudo nano eth0.network.

/etc/systemd/network/eth0.network

[Match]
Name=eth0   

[Network]
DHCPServer=yes
Address=192.168.0.1/24
ConfigureWithoutCarrier=yes

[DHCPServer]
PoolOffset=100
PoolSize=100

More options are to be found in manpage man systemd.network.

After you have finished your config, enable systemd-networkd.service via:

sudo systemctl enable systemd-networkd.service &&\
sudo systemctl restart systemd-networkd.service

And view your settings via networkctl again.

PS you should edit your /etc/resolv.conf via sudo nano /etc/resolv.conf and add some nameservers there, for example Google DNS: nameserver 8.8.8.8.

PPS better use systemd-resolved.service in combination with a bind9 server.