This is my network configuration:

enter image description here

I have three VLANs in my home network. VLAN1 is the default LAN with no domain name, just a workgroup name. VLAN2 is a LAN with domain name of A. VLAN3 is a LAN with domain name of B. I have users on either VLAN1 or VLAN2. I have multiple web services running on all 3 VLAN. Most of which are on VLAN2 and VLAN3. In order to properly resolve URLs (e.g. A.com, A.com/Test1, A.com/Test2, or B.com) externally, I use a combination of reverse proxy (Nginx) and port forwarding (via router).

The problem is that I want to use the same URLs internally as well; however, I can't figure how to configure my home network to properly resolve them properly. Users on VLAN1 use the router as DNS and resolve the URLs to be the router's external IP address, which is wrong. Port forwarding doesn't work for intranet. Users on VLAN2 use the Active Directory server as DNS and resolve only A.com URLs to itself. Other URLs under A.com would not get referenced correctly as it is handled by Nginx server externally when it is port forwarding from the router.

  • You are conflating 2 probes - DNS resolution and creating a tcp connection. These need to be handled separately. – davidgo Dec 22 '18 at 1:09
  • Can you explain how I can separate them? Currently, I am using port forwarding to Nginx server and use reverse proxy with Nginx to redirect URLs to the right server handler for external access. I am only using DNS server for internal access. – Ice Drake Dec 22 '18 at 1:25
  • 1
    I can't suggest anything specific because I don't know enough about your setup. In the loosest terms though - I'd maybe set up a DNS server with the appropriate mappings for your domains (probably to the internal IP address of your NGINX system) which also does recursive DNS. I'd then I'd instruct the DHCP servers for each router to hand out this DNS servers IP. – davidgo Dec 22 '18 at 1:30
  • You lost me in setting up the Nginx for DNS. How can it be configured to handle DNS requests? The only configuration I am aware of is "proxy pass" and "server name". They don't handle DNS queries like dnsmasq do. – Ice Drake Dec 22 '18 at 5:12
  • 1
    I was recommending setting up a DNS server (eg bind or dnsmasq) and using that to point to the IP address of your NGINX proxy for the affected records. I don't believe you can use NGINX for DNS. – davidgo Dec 22 '18 at 6:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.