2

I have a Django/Apache server that runs in my home, and currently I can only access it by using the IP address.

I'm sorry if this sounds novice but, how would one go about configuring an Apache/Ubuntu home server so all devices on that network can visit the server from a more memorable/cheerful domain name (eg. "http://MyHomeServer.com/")?

Would this require any router settings to be modified or is there a way I could do this purely from within the Linux server?

Thanks.

4
  • 1
    You would need a domain name, a dynamic DNS update system/service in use, and port forwarding on your router to make this all work.
    – Thomas Ward
    Aug 6, 2018 at 20:06
  • Does your IP address inside the network change? If so, I would recommend making that a static IP address. (We can give directions how to do that, if you need. Look at the output of ifconfig and cat /etc/resolv.conf get the info you need for that.)
    – Azendale
    Aug 6, 2018 at 23:15
  • @Azendale, The server has been configured for static IP addressing, all of the rest of the devices on the internal network are currently DHCP.
    – Logic1
    Aug 7, 2018 at 1:30
  • What is the IP address of your server, on the internal network? Is there anything in the answer that I wrote you need clarified?
    – Azendale
    Aug 9, 2018 at 20:26

2 Answers 2

1

Check out DNSmasq.

http://www.thekelleys.org.uk/dnsmasq/doc.html

It's as easy as changing a single file and it affects all devices on your network.

DNSmasq is a DNS server for your network. It's pretty small and can run on a Raspberry Pi.

I do suggest buying the domain name you want to replace your site to.

Check out this, there is a nice guide on how to do it: How to redirect a URL to a custom IP address?

0

For the most part, you don't actually have to change much, if anything with Django or Apache. You just need to change stuff with DNS, IP addresses and potentially port forwarding.

First, a question. Do you know if your machine always has the same address inside the network? Second, do you want to be able to get to to this site from other places on the internet (note that doing so means the rest of the world can try to access your Django project and try to exploit any vulnerabilities it may have.) Third, (if you answered yes to question 2) does your public IP address change? (If so, you can either do more work to set up Dynamic DNS or pay your ISP a fee to get a fixed address. If you do not know on this question, go to ipchicken.com, record the address there, reboot your router/modem, and check again. Is it the same?) Fourth (if you answered yes to #2), what router do you have?

To give a general overview, you will probably end up wanting to buy a domain name. You can do so at a place like godaddy.com or namecheap or a million other competitive domain providers.

Then you will want to add a DNS record for the IP address your machine has. This would be an 'A' record type for IPv4 or 'AAAA' type for IPv6 (if you're lucky enough to have that.) If you are trying to get to this from inside your network on IPv4, you will want to use the internal network address in the DNS. If you want to be able to get to it from the general internet, we'll need to set it up with your address shown by ipchicken.com AND set up port forwarding, and then maybe do something extra in your local router if you want to also be able to access it from inside. So just accessing it from inside is much easier than being able to get to in from "anywhere on the internet".

Hopefully that gives a good overview of the steps.

1
  • An example of setting MyHomeServer.com recognized by any machine on the home network redirecting to a specific machine on the home network would garner an upvote. Sep 29, 2019 at 23:34

You must log in to answer this question.

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