3

I'm creating a Minecraft server with an old desktop computer (a HP Pavilion) running Ubuntu 22.04 and when trying to set up a local static IP, my DNS appears to stop working entirely. At first, I used netplan to edit the connection details, but as I wasn't confident in editing system files (and I couldn't get it to work!), I just used the Ubuntu GUI for manually setting the IP address.

Before I set the address, I checked my router DHCP range (192.168.1.10-254), which meant I could select 192.168.1.2-9 as my static IP - not 192.168.1.1, as that's my router's IP. I went to Settings and after changing the IPv4 Method to Manual, I set my Address to 192.168.1.5, the Netmask to 255.255.255.0 and the Gateway to 192.168.1.1 - my router address - and I successfully connected, which I verified by going into my router web interface and checking the IP assigned.

Everything seemed fine, so I opened Firefox and attempted a search. When this returned a Server Not Found page, I tried https://1.1.1.1 and it showed up as normal. I tried this with a few other IPs and hostnames, and ran ping in the terminal, but it still failed with hostnames, which pointed to a DNS error. I went back to the Settings, disabled Automatic DNS and tried the 1.1.1.1,1.0.0.1 (Cloudflare) DNS addresses. Still no luck. 8.8.8.8,8.8.4.4 (Google DNS) didn't work either.

After searching the internet, none of the answers I've found can fix the DNS - they all say how to change the servers, and it isn't making a difference. I'm also unsure about the Routes part of the IPv4 settings, so I've left that on Automatic.

I am vaguely new to both Ubuntu Desktop and Ask Ubuntu, so if I'm making a stupid mistake or I need to add more information to the question, just tell me :)

5
  • 1
    If you have a closed network then where is the DNS server that the machines can resolve against?
    – David
    Nov 6, 2022 at 15:41
  • @David I don't know much about networks, but I'm connecting to a router with an internet connection and an ISP's DNS server - I'm only setting a static IP so I can port forward safely to that computer only. Even if the router DNS didn't work, though, I thought a Cloudflare or Google DNS would work fine. Would the DNS still work? Nov 6, 2022 at 15:48
  • 2
    In your router you can assign your HP server a reserved IP address, via the MAC address of your HP server, that way it always gets the same IP and you can assign it both inside or outside your DHCP range. Then your server will always get the same IP address and also get the DNS settings, etc as long as the server is set to DHCP. Having a reserved IP in your DHCP range will not cause any IP duplicates as your DHCP server on your router will block that IP address from going to any other device.
    – Terrance
    Nov 6, 2022 at 15:58
  • 1
    What ever you did to the config has stopped it from finding the DNS. Follow @Terrance suggestion and it will work fine.
    – David
    Nov 6, 2022 at 16:01
  • @Terrance Thanks for the suggestion! I actually came across reserving IPs while trying to find the setting for static IPs in my router settings, but the two ideas never crossed in my head (I was following a tutorial for port forwarding and it told me to use a static IP). I'll try reserving the IP alongside the port forwarding, and if you want to make your comment an answer, I'll accept it! Nov 6, 2022 at 16:02

1 Answer 1

5

In your router you can assign your HP server a reserved IP address, via the MAC address of your HP server, that way it always gets the same IP and you can assign it both inside or outside your DHCP range. Then your server will always get the same IP address and also get the DNS settings, etc as long as the server is set to DHCP. Having a reserved IP in your DHCP range will not cause any IP duplicates or conflicts as your DHCP server on your router will block that IP address from going to any other device.

3
  • 1
    Works perfectly. Just tested it out, and everything's working as expected! Thanks again. Nov 6, 2022 at 16:06
  • 1
    @BestCoderBoy No problem! Glad it worked out for you! :)
    – Terrance
    Nov 6, 2022 at 16:07
  • 2
    I think the issue was that your router tells the clients (your MC server in this case) what DNS to use. So you stopped DHCP meaning that only the local configuration was being used, so you also needed to tell the MC server what DNS servers to use. There are a lot of different ways to do this, but Ubuntu uses systemd-resolved by default (I gather). Output of resolvectl would probably have shown where the issue lay.
    – pbhj
    Nov 6, 2022 at 16:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .