Access via external IP works but website name doesn't

Discussion in 'General' started by soch, Sep 14, 2009.

  1. soch

    soch New Member

    When I give the external IP of my router http://w.x.y.z it takes me to my website.

    But when I enter http://www.domain1.com (domain1 is an example), I get address not found error. http://domain1.com doesn't work either.

    1. I have my domain registered via GoDaddy.com. I have changed the nameservers to point to the external IP address of my router. Note: both ns1 & ns2 point to the same external IP of my router w.x.y.z.

    2. I have forwarded all the requests on port 80 to my ubuntu server internal IP address in the router firewall settings.

    3. I have created several records in ISPconfig3 as follows:

    Record type Name Data Priority
    =========================================================
    A domain1.com internal IP of the ubuntu server 0
    A www internal IP of the ubuntu server 0
    MX domain1.com mail.domain1.com 10
    NS domain1.com ns1.domain1.com 0
    NS domain1.com ns2.domain1.com 0

    4. The DNS zone has following settings:
    Server: server1.domain1.com
    Client: empty
    Zone (SOA): domain1.com. (dot in the end)
    NS: ns1.domain1.com. (dot in the end)
    email: mail.domain1.com. (dot in the end)



    5. I don't have static IP from fios service. But the external IP (w.x.y.z) hardly changes.


    Any help or suggestions will be appreciated.
     
    Last edited: Sep 14, 2009
  2. till

    till Super Moderator

    You have to use the external IP address in DNS records and not the internal IP address and there must be a dt at the end of the A record for domain1.com so that it reads "domain1.com."
     
  3. soch

    soch New Member

    Made those changes:
    Record type Name Data Priority
    ================================================== =======
    A domain1.com. External IP of router 0
    A www. External IP of router 0
    MX domain1.com. mail.domain1.com 10
    NS domain1.com. ns1.domain1.com 0
    NS domain1.com. ns2.domain1.com 0


    All above records have dot in the end for host.

    Still same problem.

    Note: I am able to see the web page properly when using the IP address but not using the website page. Does it mean there is some problem with name translation?
     
  4. soch

    soch New Member

    intodns.com info, errors:

    Parent Domain NS records Nameserver records returned by the parent servers are:

    ns1.domain1.com. ['w.x.y.z'] [TTL=172800]
    ns2.domain1.com. ['w.x.y.z'] [TTL=172800]

    a.gtld-servers.net was kind enough to give us that information.

    NS NS records from your nameservers NS records got from your nameservers listed at the parent NS are:
    Oups! I could not get any nameservers from your nameservers (the ones listed at the parent server). Please verify that they are not lame nameservers and are configured properly.

    ----------->>>>>>>>> WHY?

    Mismatched NS records WARNING: One or more of your nameservers did not return any of your NS records.
    DNS servers responded ERROR: One or more of your nameservers did not respond:
    The ones that did not responded are:
    w.x.y.z

    Multiple Nameservers ERROR: Looks like you have less than 2 nameservers. According to RFC2182 section 5 you must have at least 3 nameservers, and no more than 7. Having 2 nameservers is also ok by me. ---> DO I NEED TO HAVE 2 DIFFERENT IPs FOR NS1 & NS2????

    Missing nameservers reported by your nameservers You should already know that your NS records at your nameservers are missing, so here it is again:

    ns1.domain1.com.
    ns2.domain1.com.



    SOA SOA record No valid SOA record came back!

    MX MX Records Oh well, I did not detect any MX records so you probably don't have any and if you know you should have then they may be missing at your nameservers!

    WWW WWW A Record ERROR: I could not get any A records for www.domain1.com!

    (I only do a cache request, if you recently added a WWW A record, it might not show up here.)
     
    Last edited: Sep 14, 2009
  5. giftsnake

    giftsnake New Member

    • No Dots at the in A records for hostnames (e.g. www)
    • I think you need 2 Nameservers with different IPs

    your zonefile should look like this:

    Code:
    A domain1.com. External IP of router 0 (dot at the end)
    A www External IP of router 0 (NO dot at the end)
    A mail External IP of router 0
    MX domain1.com. mail.domain1.com 10
    NS domain1.com. ns1.domain1.com 0
    NS domain1.com. ns2.domain1.com 0
     
  6. soch

    soch New Member


    The zone records look like above. Infact, I deleted the old DNS zone entry and created a new one using the DNS Wizard.

    I don't have 2 external IPs for nameserves.
     
  7. giftsnake

    giftsnake New Member

    lets say, your external ip is 12.34.56.78

    what you need is EXACTLY this (not as your above: look for the dots at the end of the entrys!!!)
    Code:
    A domain1.com. 12.34.56.78
    A www 12.34.56.78
    A mail 12.34.56.78
    A ns1 12.34.56.78
    A ns2 12.34.56.78
    MX domain1.com. mail.domain1.com
    NS domain1.com. ns1.domain1.com
    NS domain1.com. ns2.domain1.com

    btw: a dot at the end of the entry means, that the domainname is NOT added there. No dot at the end means, that domain.com is added.
    example:
    A www. 12.34.56.78 is for a DOMAIN called www (which is not allowed)
    A www 12.34.56.78 is for www.domain.com, according to SOA

    maybe you can ignore that with the 2 different ips for nameserver, just give it a try!
     
  8. soch

    soch New Member



    Thanks for the help.

    I added 2 more A records for ns1 & ns2. Added the dots where needed. I still have the same problem: "One or more of your nameservers did not return any of your NS records."

    Here's what the entries look like:
     

    Attached Files:

    • 1.jpg
      1.jpg
      File size:
      37.1 KB
      Views:
      412
    • 2.jpg
      2.jpg
      File size:
      21.1 KB
      Views:
      417
  9. soch

    soch New Member

    Tried as above (added 2 A records for ns1 & ns2) & put dots at the end of hostnames as above, but I am getting the same problem. IntoDNS.com still says that nameservers are not responding.
     
  10. till

    till Super Moderator

    Run this command directly on the server and post the output:

    dig @localhost domain1.com
     
  11. soch

    soch New Member

    # dig @localhost domain1.com --> edited to domain1

    ; <<>> DiG 9.5.1-P2 <<>> @localhost domain1.com
    ; (2 servers found)
    ;; global options: printcmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 38765
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

    ;; QUESTION SECTION:
    ;domain1.com. IN A

    ;; Query time: 115 msec
    ;; SERVER: 127.0.0.1#53(127.0.0.1)
    ;; WHEN: Wed Sep 16 02:23:33 2009
    ;; MSG SIZE rcvd: 34
     
  12. till

    till Super Moderator

    Ok, looks as if no dns server is running. Then run the command and post the output:

    netstat -tap | grep dns
     
  13. soch

    soch New Member

    Yup. No data returned:
    root@Bada:~# netstat -tap | grep dns
    root@Bada:~#
    root@Bada:~# vi /etc/init.d/mydns
    root@Bada:~# ls -l /etc/init.d/mydns
    -rwxr-xr-x 1 root root 1402 2009-09-03 10:42 /etc/init.d/mydns
    root@Bada:~# update-rc.d mydns defaults
    update-rc.d: warning: /etc/init.d/mydns missing LSB information
    update-rc.d: see <http://wiki.debian.org/LSBInitScripts>
    System startup links for /etc/init.d/mydns already exist.
    root@Bada:~#
     
    Last edited: Sep 16, 2009
  14. till

    till Super Moderator

    Run:

    /etc/init.d/mydns start
     
  15. soch

    soch New Member

    root@Bada:~# /etc/init.d/mydns start
    Starting DNS server: mydns.

    root@Bada:~# netstat -tap | grep dns
    root@Bada:~# /etc/init.d/mydns start
    Starting DNS server: mydns.
    root@Bada:~# netstat -tap | grep dns
    root@Bada:~#

    Is mydns crashing?
     
    Last edited: Sep 16, 2009
  16. falko

    falko Super Moderator

    What's the output of
    Code:
    netstat -tap
    ?
     
  17. soch

    soch New Member


    Code:
    root@server1:~# netstat -tap
    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State                                                                                                    PID/Program name
    tcp        0      0 *:npmp-gui              *:*                     LISTEN                                                                                                   2554/ypbind
    tcp        0      0 server1.domain1:10024 *:*                     LISTEN                                                                                                   2709/amavisd (maste
    tcp        0      0 server1.domain1:10025 *:*                     LISTEN                                                                                                   3527/master
    tcp        0      0 *:mysql                 *:*                     LISTEN                                                                                                   2786/mysqld
    tcp        0      0 server1.domain1:spamd *:*                     LISTEN                                                                                                   2868/spamd.pid
    tcp        0      0 *:sunrpc                *:*                     LISTEN                                                                                                   2196/portmap
    tcp        0      0 *:http-alt              *:*                     LISTEN                                                                                                   499/apache2
    tcp        0      0 *:www                   *:*                     LISTEN                                                                                                   499/apache2
    tcp        0      0 *:ftp                   *:*                     LISTEN                                                                                                   3543/pure-ftpd (SER
    tcp        0      0 *:ssh                   *:*                     LISTEN                                                                                                   2505/sshd
    tcp        0      0 server1.domain1.c:ipp *:*                     LISTEN                                                                                                   3890/cupsd
    tcp        0      0 *:smtp                  *:*                     LISTEN                                                                                                   3527/master
    tcp        0      0 server1.domain1.c:953 *:*                     LISTEN                                                                                                   2479/named
    tcp        0      0 *:https                 *:*                     LISTEN                                                                                                   499/apache2
    tcp        0      0 server1.domain1:mysql server1.domain1:53718 ESTABLISHED                                                                                              2786/mysqld
    tcp        0    300 server1.domain1.c:ssh 192.168.1.4:2958        ESTABLISHED                                                                                              7112/0
    tcp        0      0 server1.domain1:53718 server1.domain1:mysql ESTABLISHED                                                                                              2810/amavisd (ch2-a
    tcp       58      0 server1.domain1:40667 server1.domain1:10025 CLOSE_WAIT                                                                                               2811/amavisd (ch1-a
    tcp6       0      0 [::]:imaps              [::]:*                  LISTEN                                                                                                   3394/couriertcpd
    tcp6       0      0 [::]:pop3s              [::]:*                  LISTEN                                                                                                   3438/couriertcpd
    tcp6       0      0 [::]:pop3               [::]:*                  LISTEN                                                                                                   3413/couriertcpd
    tcp6       0      0 [::]:imap2              [::]:*                  LISTEN                                                                                                   3369/couriertcpd
    tcp6       0      0 [::]:ftp                [::]:*                  LISTEN                                                                                                   3543/pure-ftpd (SER
    tcp6       0      0 [::]:domain             [::]:*                  LISTEN                                                                                                   2479/named
    tcp6       0      0 [::]:ssh                [::]:*                  LISTEN                                                                                                   2505/sshd
    tcp6       0      0 localhost:ipp           [::]:*                  LISTEN                                                                                                   3890/cupsd
    tcp6       0      0 localhost:953           [::]:*                  LISTEN                                                                                                   2479/named
    
    
    Following 2 entries didn't have the full names of the domain. The last character of the domain name was truncated
    
    tcp        0      0 server1.XXXXXX:domain *:*                     LISTEN                                                                                                   2479/named
    tcp        0      0 server1.xxxxxx:domain *:*                     LISTEN                                                                                                   2479/named
    root@server1:~#


    So if domain name was domainXYZ the above two "named" entries were:

    tcp 0 0 server1.domainXY:domain *:* LISTEN 2479/named
    tcp 0 0 server1.domainXY:domain *:* LISTEN 2479/named

    Is that the problem?
     
    Last edited: Sep 18, 2009
  18. falko

    falko Super Moderator

    named (aka BIND) is running, therefore MyDNS cannot be started. Please stop BIND and start MyDNS.
     
  19. soch

    soch New Member

    Thanks I did that. Same problem.

    root@Server1:/# netstat -tap | grep dns
    tcp 0 0 server1.domainXY:domain *:* LISTEN 11644/mydns
    tcp 0 0 server1.domainXY:domain *:* LISTEN 11644/mydns
    tcp6 0 0 localhost:domain [::]:* LISTEN 11644/mydns
    root@server1:#

    Why is the domain name truncated? domainXY instead of domainXYZ
     
  20. falko

    falko Super Moderator

    But now MyDNS is running. Isn't that what you wanted?
     

Share This Page