I am running on my raspberry (Debian wheezy) the services DHCP, Apache2, MySQL and Bind9. All work fine within the internal network. However, when I try to access the website from internet, it can't be loaded.

I am aware that registrars usually request 2 dns, mine accepted the entry of only one dns. For my purpose I don't want to set up a second one if it is not really absolutely necessary.

The hostname is "rpi-server" has a static IP and all services are hosted on the same machine.
The modem/router/gateway has IP
The public IP is

These are the bind settings:

File /etc/bind/named.conf.local

zone "famwagner.ch" {
        type master;
        file "/etc/bind/db.famwagner.ch";

zone "1.168.192.in-addr.arpa" {
        type master;
        file "/etc/bind/db.famwagner.ch.inv";

File /etc/bind/named.conf.options

options {
    directory "/var/cache/bind";

    dnssec-validation auto;

    auth-nxdomain no;    # conform to RFC1035
    listen-on-v6 { any; };

File /etc/bind/db.famwagner.ch

$TTL    3600
@   IN  SOA rpi-server.famwagner.ch root.famwagner.ch (
            2015030305  ; Serial
            3600        ; Refresh
            120     ; Retry
            600     ; Expire
            86400)  ; Negative Cache TTL

; Name servers
@       IN  NS  rpi-server.famwagner.ch.
@       IN  MX  10 rpi-server.famwagner.ch.

; A records for name servers
internal-rpi-server IN  A
rpi-server      IN      A

; Other A records
internetbox     IN      A
nas             IN      A
raspberry       IN      A

; CNAME records
router          IN      CNAME   internetbox
www             IN      CNAME   rpi-server
phpmyadmin      IN      CNAME   rpi-server

File /etc/bind/db.famwagner.ch.inv

@       IN  SOA     rpi-server.famwagner.ch. root.famwagner.ch. (
            600 )

; define the authoritative name servers
        IN  NS      rpi-server.famwagner.ch.

; our hosts, in numeric order
1       IN  PTR     internetbox.famwagner.ch.
5       IN  PTR     rpi-server.famwagner.ch.
10      IN  PTR     nas.famwagner.ch.
130     IN  PTR     raspberry.famwagner.ch.

File /etc/hosts   localhost
::1     localhost ip6-localhost ip6-loopback
fe00::0     ip6-localnet
ff00::0     ip6-mcastprefix
ff02::1     ip6-allnodes
ff02::2     ip6-allrouters rpi-server.famwagner.ch rpi-server

Can anyone advise if I'm having a wrong bind config causing the issue that I can't access the websites from the web?

Any help is appreciated.


  • 4
    Did you forward the port in your router. The Ip address you set is not routable on the internet (it is a private IP). Commented Feb 27, 2015 at 12:48
  • Yes, my router forwards all ports to the raspberry acting as server. I can access the site using the public IP.
    – Marco
    Commented Feb 27, 2015 at 12:59
  • This question is really way off-topic here. If you can't find an answer that works, you should use U&L or Superuser -- but please don't cross-post, leave a comment @goldilocks and I will close this.
    – goldilocks
    Commented Mar 6, 2015 at 17:16
  • @goldilocks Why is this way off-topic? I'm running a webserver (with some more services) on my raspberry and having this issue.
    – Marco
    Commented Mar 9, 2015 at 6:38
  • Because the fact that it's a raspberry pi is irrelevant. By that logic, there should be a Thinkpad site where people can ask exactly the same question "but it's on a Thinkpad" or an Asus motherboard site where people can ask the exact same question "but my desktop has an Asus mobo w/ newer Intel socket" -- who cares? Anyway, looks like you've got an answer and solved your problem, so no worries. The point is, you'd get more help from people with more particular expertise solving networking problems on linux on one of the much busier, much larger userbase sites.
    – goldilocks
    Commented Mar 9, 2015 at 13:59

1 Answer 1


If you put rpi-server.mydomain.com in the address of a web browsers that is not on your loacl network the browser will be told by your DNS to contact

dig rpi-server.famwagner.ch | grep -v \; | grep ..
rpi-server.famwagner.ch. 604775 IN  A is a private IP and is not reachable. Adding the WAN IP of your NAT to your DNS and port forwarding will correct this.

internal-rpi-server  IN  A
rpi-server  IN  A

DNS can take 72h to propagate if you don't apply other tricks so wait to be sure.

Additionally your NS is setup wrong:

dig rpi-server.famwagner.ch NS | grep -v \; | grep ..
famwagner.ch.       3547    IN  SOA rpi-server.famwagner.ch.famwagner.ch. root.famwagner.ch.famwagner.ch. 2015030306 3600 120 600 86400

so your updates won't propagate. (rpi-server.famwagner.ch.famwagner.ch should be rpi-server.famwagner.ch)

putting a $ORIGIN . before your SOA will let you use the full name without suffixing it, use $ORIGIN famwagner.ch. to restore the default suffix.

Some ISPs offer IPv6 which would be another way around NAT.

If you are asking a different question please clarify.

  • I have a registered domain and a fix public IP. Also the DNS (rpi-server. mydomain.com) and the IP are registered with my TLD registrar.
    – Marco
    Commented Mar 2, 2015 at 5:52
  • Domain name is not required to access IP from internet. Commented Mar 2, 2015 at 6:37
  • @Chetan, Marco said "I can access the site using the public IP." Commented Mar 2, 2015 at 6:41
  • @Marco please be more specific (list every setting in the chain of events) (real IPs and domains would help us help you, and everyone has to learn sometime so there is no reason to hide what is public information) Commented Mar 3, 2015 at 0:47
  • @user1133275 I have updated my post with the domain / public IP and added the content of my hosts file. In apache2 I use the default configuration. What else would be helpful information?
    – Marco
    Commented Mar 3, 2015 at 7:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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