My Internal Network Setup and Configuration
Prologue
For example, I have following services running in my local network.
- Git Server: Located at
192.168.1.100:80
- Jellyfin Server: Located at
192.168.1.101:8000
- NAS (Network Attached Storage): Located at
192.168.1.101:8010
Is there any good way to access them without typing ip address?
Yes. In this blog post, I'll walk you through how I set up my internal network.
Setting Up a Private DNS Server
The first step in our journey is to set up a private DNS server within our local network. For this, I chose AdGuardHome, which I deployed at 192.168.1.102
.
With AdGuardHome, I was able to set up custom DNS resolutions. For instance:
server1.cuora
resolves to192.168.1.101
server2.cuora
resolves to192.168.1.100
However, if a service operates on a different port, we need to employ a reverse proxy, like nginx, to handle the traffic.
Setting Up a Reverse Proxy
I set up a proxy server at 192.168.1.103
. This means that any requests to *.internal.cuora
are directed to the proxy server at 192.168.1.103
.
Nginx Configuration
Here's a brief overview of my nginx setup:
- For
jellyfin.internal.cuora
, traffic is directed to192.168.1.101:8000
- For
git.internal.cuora
, traffic is directed to192.168.1.100:80
- For
nas.internal.cuora
, traffic is directed to192.168.1.101:8010
With this configuration, I can easily access all my internal services using domain names, making the entire process seamless and user-friendly.
Example Config
1 | server { |
don't forget to add a default nginx config
1 | server { |
Settup Router
This part is quite easy. In DHCP setting, just set default DNS server to our own private dns server 192.168.1.102
.