Search code examples
dnsserverrouterlan

Have router resolve domain to local IP


I need my router to resolve mydomain.com to a private IP. Alternatives like modifying hosts file or using a paid dynDNS service will not do. Is this possible? Thanks.


Solution

  • Well, you need to create an A record for "mydomain.com" to point to whatever your public IP is (I am assuming this is the IP that your ISP is assigning). This can only be done, afaik, where you registered the domain.

    On your home side, you need to enable port forwarding (80,8080,443) on your router. Point this to your internal IP, or where you are hosting this server. This means that all requests going to mydomain.com will come to your router and be forwarded to the internal address.

    Be careful when using dynamic IP addresses. Your ISP will most likely change this IP every so often, so your website will not be reachable from the internet unless it is changed in DNS.