Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to finish making a minecraft server (TCP/UDP)

I already have a system that uses a private ip of

And a DNS on it that uses the public ip of, then redirects to it from with ddclient

But when I start the server it lets me connect on minecraft through the internal ip but not the public ip or the hostname? The server uses port 25565 but I always get connection refused if I attempt to connect with the hostname or public ip?

I can connect to the server in my web browser but although the config is correct (as far as I know) I can't connect to it on minecraft, also even when I connect from the public ip it doesn't say if anyone attempted to connect to the server and was refused. Was this because the connection didn't get past the public ip or hostname firewall?

Maybe it's because my config in /etc/network/interfaces isn't right?

I am not able to use a static ip address in the config because my isp doesn't offer it

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp
        post-up iptables-restore < /etc/iptables.up.rules
share|improve this question
up vote 1 down vote accepted

I am going to start my answer by clarifying some facts/assumptions I pulled from your question:

  • Your domain name is
  • points to public IP (this I tested and know)
  • is your home IP.
  • The computer you are running a minecraft server on, has a private IP of inside your home network.

Congrats, the good news is that you only have one more step and it does not require setting up a new DHCP server, rather just setting up port-forwarding on your router/hub, and optionally tweaking its DHCP settings.

All that remains is to set up port forwarding on your "home hub" (router). Unfortunately, every router I have seen has a different interface and feature set, but 99% of the time there is an "advanced" are you may need to log into, and then there should be a tab/menu called "port forwarding" where you just need to specify the IP/MAC/Hostname of your computer (192,168.0.9) and the port you want to forward (TCP 25565)

enter image description here

DHCP Settings

You can optionally tweak the DHCP settings on the router to prevent your private internal IP of your minecraft server ( from changing (assuming its set to DHCP and not statically set). However minecraft should still work in the meantime. This is just to prevent you having to re-set up port forwarding every time your internal IP changes. It is best not to manually set your private IP to an address in the same range as the DHCP pool of your router as this can (low risk) lead to an IP clash (two devices using the same IP)

Thus the easiest solution is to check the IP range of the DHCP pool (shown below) and set your server's IP to something that is in the same subnet but not the same address pool. - in the picture below: enter image description here

Either that, or some routers allow you to manually set a static/reserved IP from within the DHCP pool to a device based on its MAC/hostname.

Reference Material - Minecraft Wiki - Setting Up A Server

share|improve this answer
I saw your connection then pinged you ;) – user240010 Jan 26 '14 at 19:48
@user240010 May have been me port scanning your IP. – douggro Jan 26 '14 at 19:49
A good answer, but I have one issue: I get that BT refers to their routers as a "Home Hub" but in networking device parlance, this is a misnomer. The device is a router, through and through. A networking hub device is similar to a switch, without the packet routing capabilities - and frankly networking hubs have all but disappeared from the marketplace. I've seen you use this reference in a couple of posts, and believe that users may get confused by the reference to "home hub". Please use "router" as the correct term. – douggro Jan 26 '14 at 20:00
BT and I refer to it as a "hub" because to people like us, a router is something like this: which can take in multiple feeds and perform a lot of more complicated "work", but yes, for all intents and purposes the home hub is a router because it connects two networks and uses tables to decide where to "route" the traffic. – Programster Jan 26 '14 at 20:05
Definitions of hubs, switches and routers. Times have changed from when routers and switches were solely the domain corporations and data centers.. :-) – douggro Jan 26 '14 at 20:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.