LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Cannot get to website using domain name (http://www.linuxquestions.org/questions/linux-server-73/cannot-get-to-website-using-domain-name-947257/)

cryingthug 05-28-2012 03:17 PM

Cannot get to website using domain name
 
I cannot see to get to my site by domain name. I can get to it by IP address fine. I am guessing that the problem is with the Bind configuration file... or maybe Apache?

This works:
Code:

$ dig @dnsserver linuxquestions.org
Which means that DNS is working.
When I type in the browser the IP this works:
Code:

http://192.168.69.221/a_test_website
But this does not work:
Code:

http://mytestwebsite.com
Here is the db.atestsite.com file.
Code:

; BIND data file for mytestsite.   
;                     
$ORIGIN dynamicdnsname.here.com
$TTL        604800     
;Name of the primary ns and the email of the administrator.
@          IN  SOA ns.mytestsite.com. admin.mytestsite.com. (
            2012052806 ;Serial                                                     
            604800      ; Refresh
            86400      ; Retry
            2419200    ; Expire
            604800 )    ; Negative Cache TTL
;                     
;Tells dns servers on the Internet the primary ns server that have authorit    y
            IN  NS  ns.mytestsite.com.

;Anchor records that point to your domain.
;The address localhost.mytestsite.com can only be accessed by the server itself.
localhost  IN  A      127.0.0.1

;The domain name. The number should be the Public IP address.
;This is the address they ping or browse to http://mytestsite.com.
mytestsite.com. IN  A      201.133.69.25

;Pinging ns.mytestsite.com. would return the public IP address.
ns          IN  A      192.168.69.221

;Browsing www.mytestsite.com. would take the viewer to the site.
www        IN  A      192.168.69.221

;Makes http://www.mytestsite.com. the same as http://forum.mytestsite.com.
forum      IN  CNAME  www


cryingthug 05-28-2012 03:19 PM

Oh, btw, I am using Debian 6 and Apache2 Bind9.

nibraz 05-28-2012 04:47 PM

I had the same issue.. make sure your router is port forwarding 80 and 53. Here is how my zone file looks, and it works perfectly.

Code:

$TTL        3600
@      IN      SOA    ns1.mydomain.com. my.email.com. (
                        2012041603      ; serial, todays date + todays serial #
                        7200              ; refresh, seconds
                        540              ; retry, seconds
                        604800              ; expire, seconds
                        86400 )            ; minimum, seconds
;

mail          3600      A                        81.xxx.xxx.xxx
mydomain.com. 3600      A                          81.xxx.xxx.xxx
mydomain.com. 3600      MX    10                mail.mydomain.com
mydomain.com. 3600      NS                      ns1.mydomain.com
mydomain.com. 3600      NS                      ns2.mydomain.com
www                3600      A                          81.xxx.xxx.xxx
ns1.mydomain.com. IN A 81.xxx.xxx.xxx
ns2.mydomain.com. IN A 81.xxx.xxx.xxx


cryingthug 01-14-2013 07:20 AM

working!
 
Forwarding the port worked. However I am getting the domain name of the router appended to the nslookup query.

domain name = adomain.tt.net
router's domain name = extradomain.com

Look at the output under Non-authoritative answer.

Code:

C:\Documents and Settings\johnny>nslookup xyz.us.to
*** Can't find server name for address 192.168.X.X: Non-existent domain
*** Default servers are not available
Server:  UnKnown
Address:  192.168.X.X

Non-authoritative answer:
Name:    adomain.tt.net.extradomain.com
Address:  32.21.165.32


cryingthug 01-23-2013 09:23 PM

3600
 
nibraz:

Why did you write 3600 in the second column? I have never seen that before.

Code:

mail          3600      A                        81.xxx.xxx.xxx
mydomain.com. 3600      A                          81.xxx.xxx.xxx
mydomain.com. 3600      MX    10                mail.mydomain.com
mydomain.com. 3600      NS                      ns1.mydomain.com
mydomain.com. 3600      NS                      ns2.mydomain.com
www                3600      A                          81.xxx.xxx.xxx


m1rr0rm3 01-24-2013 10:40 PM

Hi,

Are you using Cpanel or PLESK?

;Browsing www.mytestsite.com. would take the viewer to the site.
www IN A 192.168.69.221

The answer is actually pretty simple. If you change, in your dns.conf file the POINTER from
www IN A 192.168.69.221

to

mytestsite.com IN A 192.168.69.221

It should work

linuxmania.info 01-24-2013 11:42 PM

Hello, Please check with this.
 
Hi ,

First of all , You can check your website is working from local environment.

you can check through /etc/hosts entry....

/etc/hosts
IP domainname

192.168.*.* example.org


All times are GMT -5. The time now is 09:12 PM.