0

I have a server set up with a static IP on 192.168.1.5. Everything works fine if I access the server from outside LAN but I cannot use the server within LAN.

If I putty into the hostname (bbb.scotia.ie) outside the network, it resolves correctly, but I get a time-out from within the LAN. I can putty in using the IP address inside the network.

What am I doing wrong?

Here is the output of /etc/network/interfaces and /etc/resolv.conf:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback
        post-up ip addr add 93.107.237.199/32 dev lo
        pre-down ip addr del 93.107.237.199/32 dev lo
# The primary network interface
auto eno1
iface eno1 inet static
        address 192.168.1.5
        netmask 255.255.255.0
        network 192.168.1.0
        broadcast 192.168.1.255
        gateway 192.168.1.1
        dns-nameservers 8.8.8.8

and

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 8.8.8.8

Can anyone help? I guess its a DNS issue but don't know how to fix this.

Running Ubuntu 16.04

0
1

Welcome to Ask Ubuntu. Your question can be answered here, but it's not a Ubuntu specific issue. It really belongs in serverfault.com

If I understand this correctly, you have this server on your LAN and you port-forwarded on your router from your WAN to the internal address? And your issue is that your other computers can see the server only if they are outside your LAN (or use the internal IP)?

If so, what you have is that any internal computer asking to resolve the DNS name of "bbb.scotia.ie" will get the answer to look for 93.107.237.199, which is not an internal IP address. It will send your request outside the LAN, but since your outgoing IP is also your requested IP, it doesn't go anywhere. That's why it's not working within your LAN.

You have a couple options here:

1.NAT Reflection: if your gateway/router supports this, then enable it. pfSense has good support for it (pfSense Manual)

2.Split DNS (recommended): create your own internal DNS server, which will be queried first for all internal computers. Setup the internal DNS server so it will provide 192.168.1.5 instead of 93.107.237.199 to the internal computers. Your router might have DNS caching as well, which might be utilized for this purpose as well.

3.Write to every computer's host file: the least amount of initial work! But the one that will keep you tripping! You could edit the host file on each computer to indicate that bbb.scotia.ie should be 192.168.1.5. But we aware, if you leave the LAN, you will need to disable that entry to access it again from the outside!

3
  • Thank you for your help. Option 1 is not supported by my router. Option 2 sounds like it's feasible and option 3 may get me out of a hole. Thanks again. – Patrick Hurley Jul 9 '20 at 19:05
  • I cannot believe how stupidly easy that was. It's working perfectly now, with workaround 3. Thank you so much. – Patrick Hurley Jul 9 '20 at 19:19
  • @PatrickHurley Glad to hear you got it working. – G Trawo Jul 10 '20 at 14:25

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.