0

I'm stuck for a while on this question : I got several raspberry pis on my LAN, all with DHCP IP addresses served by MAC address resolution. I use them over several protocols : SSH, TCP. My ISP provide dynamic address, but I have a dynamic DNS system allowing me to resolve home.mydomain.com to the router without problem. I got full access to my DNS zone.

How to make mi raspberrys fully accessible by domain names (i.e module1.home.devgiants.fr) over internet, without having to set NAT for all protocols ? I read stuff around dnsmasq but all of them talked about local resolution. How can I have both internet and local resolution? I got an openWRT router on my LAN, so it would play local DNS server role if needed.

1 Answer 1

0

If the hints you have provided in your question are anything to go by, you can't do this "for the general Internet" - The assumption here is that you only have a single "real world" IP address - as implied by your advice that you have a dynamic IP address and the naming implying a home network connection.

You can, however, get this working for yourself or a select group of people.

At issue - it would appear to be confusing 2 totally separate systems - NAT - which allows you to share a single IP address between multiple devices and DNS, which, among other things, allows you to translate a host name to an IP address (but has nothing to do with NAT).

So long as you have a single IP address, you can't directly expose all of your devices to the wider Internet using a router without using NAT to map services on each device to a different port.

You can partially solve your problem by setting up an OpenVPN server on your router (or equivalent). The remote systems will need VPN clients which connect to your VPN server. If you are using OpenVPN the server needs to either be configured as a TAP device or as a TUN device which injects a route for your LAN (the latter gives you better control)

You can easily then handle the DNS by simply adding the internal IP addresses of each PI to the zone file for devgiants.com (no need to mess arround with dnsmasq) - Even though the record you are pointing to is an internal/non-routed IP address, the DNS server does not care and will provide an answer anyway. Because you have a VPN, your server will be able to find the internal IP address.

1
  • Thanks for you detailled answer and other solution explanation. As far as I see, I will focus on maintaining NAT layout and .ssh/config for ease SSH connections.
    – nbonniot
    Commented Jan 13, 2016 at 16:16

You must log in to answer this question.

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