Home Reworking Network To Allow DNS For Whole Environment
Post
Cancel

Reworking Network To Allow DNS For Whole Environment

Configuring Network to Allow Easy DNS Navigation

There are several things on my network that stop me from having easy navigation using DNS. Such as requiring a subdirectory to be in the URL or having a nonstandard port. I will be attempting to resolve most of these through various methods.

Making NUT server accessible from just it’s IP

This was fairly simple after looking around and finding a simple way of doing this. It most likely is not the fully correct way of doing this. Anyway the solution I decided to use was changing the Apache landing page to redirect immediately to the subdirectory page. This was done using a modified of version of the below code in the “head” portion of the html code. Where the number 7 in content is the delay time before being redirected.

1
2
3
4
5
6
7
8
9
<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="refresh" content="7; url='https://www.w3docs.com'" />
  </head>
  <body>
    <p>You will be redirected to w3docs.com soon!</p>
  </body>
</html>

Next was making Unifi Network management accessible from the standard 443 port

The issue with this one is that it is on a nonstandard port and Unifi Network does not allow the use of the first 1024 ports since it is ran as non-root user according to this release information.

To get around this I ran the below port redirect pre routing so that it goes to port that Unifi wants.

1
sudo iptables -t nat -I PREROUTING -p tcp --dport 443 -j REDIRECT --to-ports 8443

Now currently this will be flushed with the next restart so I needed to run the next series of commands if I did not want to download some package that does this automatically. I got this command list from this Debian Wiki page.

Save the rules to the master iptables file

1
 iptables-save > /etc/iptables.up.rules

To make sure these are loaded on reboot make a new file

1
 editor /etc/network/if-pre-up.d/iptables

Add these lines

1
2
 #!/bin/sh
 /sbin/iptables-restore < /etc/iptables.up.rules

The file needs to be executable so change the permissions for the file

1
 chmod +x /etc/network/if-pre-up.d/iptables

Now it should load on reboot or you can just use iptables-persistent.

As of now there are still several things that I have in mind to do.

  • Self-Host Website
  • Have VPN back to my home network
  • Set up my servers in a server rack
  • Get a third computer that will be able to break quorum between my two proxmox servers
  • Setup a separate computer that will ping my servers and send wake up packets if it doesn’t get a response
  • Self-host Bitwarden an open source password manager
  • Setup a bare metal backup for Proxmox as a whole
  • Setup a NAS that has at least 50 tb of storage
  • Setup a personal documenting/notes such as something like Obsidian
  • Setup a Windows server
  • Fully Configure my DNS for my local internet
  • [] Setup a dashboard to access my many services
  • [] Spin up a Security Onion VM
This post is licensed under CC BY 4.0 by the author.