ERROR 403 - Forbidden! when connect with local ip

Discussion in 'General' started by minttux, Aug 19, 2016.

  1. minttux

    minttux Member

    hi when i try to open websites from inside server like:
    Code:
    elinks http://ericomgroup.com
    I get this error:
    upload_2016-8-19_13-4-20.png
    it's my virtualhost format:
    Code:
    <Directory /var/www/...>
            AllowOverride None
                    Require all denied
            </Directory>
    
    <VirtualHost 176.9.107.196:80>
    ...
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Try to add a line:

    176.9.107.196 ericomgroup.com www.ericomgroup.com

    to the /etc/hosts file of your server.
     
  3. minttux

    minttux Member

    Yes it worked
    but i should put all domains in /etc/host ?
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    No. Normally you should just setup DNS correctly, the host file is just a workaround if dns for the domain is not setup yet or points to a different IP.
     
  5. minttux

    minttux Member

    it's my template where should i change?
    Code:
    [ZONE]
    origin={DOMAIN}.
    ns=ns1.ericomhost.com.
    mbox=d.rikhtehgaran.yahoo.co.uk.
    refresh=7200
    retry=540
    expire=604800
    minimum=86400
    ttl=3600
    [DNS_RECORDS]
    A|{DOMAIN}.|176.9.107.196|0|3600
    AAAA|{DOMAIN}.|2a01:4f8:151:54c3::2|0|3600
    CNAME|www|{DOMAIN}.|0|3600
    A|mail|178.63.48.123|0|3600
    NS|{DOMAIN}.|ns1.ericomhost.com.|0|86400
    NS|{DOMAIN}.|ns2.ericomhost.com.|0|86400
    MX|{DOMAIN}.|mail.{DOMAIN}.|10|3600
    SPF|{DOMAIN}.|v=spf1 ip4:178.63.48.123 ip6:2a01:4f8:120:6367::800 ~all|0|3600
    TXT|{DOMAIN}.|v=spf1 ip4:178.63.48.123 ip6:2a01:4f8:120:6367::800 ~all|0|3600
    TXT|_domainkey.{DOMAIN}.|t=y; o=~;|0|86400
     
  6. minttux

    minttux Member

    any idea?
     
  7. minttux

    minttux Member

    whats wrong with my dns?
    Code:
    # cat /etc/bind/pri.ericomgroup.com
    $TTL        3600
    @       IN      SOA     ns1.ericomhost.com. d.rikhtehgaran.yahoo.co.uk. (
                            2016072103       ; serial, todays date + todays serial #
                            7200              ; refresh, seconds
                            540              ; retry, seconds
                            604800              ; expire, seconds
                            86400 )            ; minimum, seconds
    ;
    
    dl 3600 A        176.9.107.196
    ericomgroup.com. 3600 A        176.9.107.196
    learngit 3600 A        178.63.48.123
    mail 3600 A        178.63.48.123
    ericomgroup.com. 3600      AAAA        2a01:4f8:151:54c3::2
    www 3600      CNAME        ericomgroup.com.
    ericomgroup.com. 3600      MX    10   mail.ericomgroup.com.
    ericomgroup.com. 86400      NS        ns1.ericomhost.com.
    ericomgroup.com. 86400      NS        ns2.ericomhost.com.
    default._domainkey.ericomgroup.com. 3600      TXT        "v=DKIM1; t=s; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDZngxhfmwtEXHM5bcaH+l8zAP/FZoUNRo2jJI2eD9z9PpfydrloAFfCzXSD+VViGYoFx914D0N8Oap261SsNSMTqafw3GPUp8Q/GCMmKOS6NQ/8YRpw9OCzJgng6OrzsyXNX6gqwwtfAXzWSIz54pYyYOGcHatG7n9eIVwcUCtzwIDAQAB"
    ericomgroup.com. 3600      TXT        "v=spf1 mx a ip4:178.63.48.123 ip6:2a01:4f8:120:6367::800 ~all"
    _domainkey.ericomgroup.com. 86400      TXT        "t=y; o=~;"
    
     
  8. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    Nothing obvious, and that domain resolves to that ip address externally for me. What DNS servers does your server use? (cat /etc/resolv.conf)
     
  9. minttux

    minttux Member

    correct
    but when i open site inside server ( with ip of server ) then faced to Forbidden:
    Code:
    its:
    mrg@server:~$ cat /etc/resolv.conf
    ### Hetzner Online GmbH installimage
    # nameserver config
    nameserver 213.133.100.100
    nameserver 213.133.99.99
    nameserver 213.133.98.98
    nameserver 2a01:4f8:0:a111::add:9898
    nameserver 2a01:4f8:0:a102::add:9999
    nameserver 2a01:4f8:0:a0a1::add:1010
    
     
  10. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    Looks like I can't query those nameservers myself, but you could try doing so manually and see what they return for your domain name. If they're not returning the right addrs for your domains, you can contact the admin there and see why.
     
  11. minttux

    minttux Member

    what should i check or do exactly or command to run ?
     
  12. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    You may have 'host' (from bind9-host) or 'dig' (from dnsutils) which you can use like
    Code:
    host ericomgroup.com. 213.133.100.100
    or
    Code:
    dig ericomgroup.com. @213.133.98.98
    to query each specific server.
     
  13. minttux

    minttux Member

    This return:
    Code:
    # host balmyshop.com. 213.133.100.100
    Using domain server:
    Name: 213.133.100.100
    Address: 213.133.100.100#53
    Aliases:
    
    balmyshop.com has address 176.9.107.196
    balmyshop.com has IPv6 address 2a01:4f8:151:54c3::2
    balmyshop.com mail is handled by 10 mail.balmyshop.com.
    
    And:
    Code:
    # dig balmyshop.com. @213.133.98.98
    
    ; <<>> DiG 9.10.3-P4-Ubuntu <<>> balmyshop.com. @213.133.98.98
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 56342
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 1
    
    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 4096
    ;; QUESTION SECTION:
    ;balmyshop.com.            IN    A
    
    ;; ANSWER SECTION:
    balmyshop.com.        3600    IN    A    176.9.107.196
    
    ;; AUTHORITY SECTION:
    balmyshop.com.        86400    IN    NS    ns1.ericomhost.com.
    balmyshop.com.        86400    IN    NS    ns2.ericomhost.com.
    
    ;; Query time: 43 msec
    ;; SERVER: 213.133.98.98#53(213.133.98.98)
    ;; WHEN: Wed Aug 24 16:20:51 IRDT 2016
    ;; MSG SIZE  rcvd: 105
    
    
    Whats wrong with it? i used another domain on server
     
  14. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    Maybe it's connecting to the IPv6 address and giving the error, did you set that address up (in your system and in ispconfig)?
     
  15. minttux

    minttux Member

    what do you mean by system?
    but there is it in ispconfig:
     

    Attached Files:

  16. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    I mean in the OS, eg. /etc/network/interfaces for debian. If you run 'ifconfig' it should show your ipv6 address.
     

Share This Page