PDA

View Full Version : [SOLVED] DNS works only locally



fuzzi
February 4th, 2012, 04:59 PM
Hey guys,

iam trying whole week to setup DNS server on desktop ubuntu 11.10. After all configuration, DNS just work only locally. (btw DNS server works also as webserver).
Configuration files are below.

ADD: I followed this link:

https://help.ubuntu.com/11.10/serverguide/C/dns-configuration.htmlADD2: I have fresh ubuntu installation with all updates. Only apache and bind was installed. IP address of the server is 85.70.125.154. If you try 85.70.125.154/index.html or 85.70.125.154/test.html, everything works. But www.automotiveparts.cz (http://www.automotiveparts.cz/) or automotiveparts.cz doesn't work.

ADD3: I have a classic ADSL conection. Iam using router TP-LINK TD-W8961NB. Server is connected to router via wifi, IP address of router is set as static by network manager to 192.168.1.150.

file/etc/bind/named.conf.options:



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

// If there is a firewall between you and nameservers you want
// to talk to, you may need to fix the firewall to allow multiple
// ports to talk. See http://www.kb.cert.org/vuls/id/800113

// If your ISP provided one or more IP addresses for stable
// nameservers, you probably want to use them as forwarders.
// Uncomment the following block, and insert the addresses replacing
// the all-0's placeholder.

forwarders {
192.168.1.1;
160.218.161.54;
88.103.200.71;
8.8.8.8;
8.8.4.4;
};

auth-nxdomain no; # conform to RFC1035
listen-on-v6 { any; };
};
file /etc/bind/named.conf.local:


zone "automotiveparts.cz"
{
type master;
file "/etc/bind/db.automotiveparts.cz";
};

zone "1.168.192.in-addr.arpa"
{
type master;
file "/etc/bind/db.192";
};
file /etc/bind/db.automotiveparts.cz


$TTL 604800
@ IN SOA ns1.automotiveparts.cz. root.automotiveparts.cz. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns1.automotiveparts.cz.
@ IN A 192.168.1.150
ns1 IN A 192.168.1.150
www IN A 192.168.1.150
file /etc/bind/db.192


$TTL 604800
@ IN SOA ns1.automotiveparts.cz. root.automotiveparts.cz. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns1.
150 IN PTR ns1.automotiveparts.cz.com.
file /etc/resolv.conf



# Generated by NetworkManager
search automotiveparts.cz
nameserver 192.168.1.150
soubor /etc/network/interfaces


auto lo
iface lo inet loopback
I modified only mentioned files. Thanks for any help.

ROUTER NAT:
http://img338.imageshack.us/img338/3807/natt.png (http://imageshack.us/photo/my-images/338/natt.png/)

arrrghhh
February 4th, 2012, 05:18 PM
DNS only works locally.

If you want to host a domain, you have to purchase it... You have to pay a domain registrar fee. You can still host the site - just point the site to your IP. But again, DNS only works locally. You can't just put up a DNS server and take over the internet :p.

volkswagner
February 4th, 2012, 05:28 PM
DNS only works locally.

If you want to host a domain, you have to purchase it... You have to pay a domain registrar fee. You can still host the site - just point the site to your IP. But again, DNS only works locally. You can't just put up a DNS server and take over the internet :p.


I see the domain is registered.

I ask the OP, is this your domain?

Partial results from:


whois automotiveparts.cz



contact: SUB_135512_82815
name: Milan Rajnoch
address: Uhliska 426
address: Rožnov pod Radhoštěm

fuzzi
February 4th, 2012, 05:29 PM
DNS only works locally.

If you want to host a domain, you have to purchase it... You have to pay a domain registrar fee. You can still host the site - just point the site to your IP. But again, DNS only works locally. You can't just put up a DNS server and take over the internet :p.

The domain www.automotiveparts.cz is of course purchased (pointing to ns1.automotiveparts.cz)

fuzzi
February 4th, 2012, 05:32 PM
I see the domain is registered.

I ask the OP, is this your domain?

Partial results from:


whois automotiveparts.cz
contact: SUB_135512_82815
name: Milan Rajnoch
address: Uhliska 426
address: Rožnov pod Radhoštěm


Yes, Its me.
So what is wrong with my DNS configuration gyus ?

volkswagner
February 4th, 2012, 05:38 PM
Check this out.

http://www.boutell.com/newfaq/creating/domainathome.html

I don't think running a DNS server is trivial. Do you have two public static ip's at your server location?

Can't you use the DNS server from your registrar?




macbook2:~ eric$ host ns1.automotiveparts.cz
Host ns1.automotiveparts.cz not found: 3(NXDOMAIN)


macbook2:~ eric$ host ns2.automotiveparts.cz
Host ns2.automotiveparts.cz not found: 3(NXDOMAIN)


macbook2:~ eric$ dig ns1.automotiveparts.cz

; <<>> DiG 9.6-ESV-R4-P3 <<>> ns1.automotiveparts.cz
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 2965
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;ns1.automotiveparts.cz. IN A

;; Query time: 892 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Sat Feb 4 11:39:25 2012
;; MSG SIZE rcvd: 40

arrrghhh
February 4th, 2012, 05:47 PM
Can't you use the DNS server from your registrar?

My apologies (especially to the OP), that's what I was trying to suggest.

fuzzi
February 4th, 2012, 05:48 PM
Check this out.

http://www.boutell.com/newfaq/creating/domainathome.html

I don't think running a DNS server is trivial. Do you have two public static ip's at your server location?

Can't you use the DNS server from your registrar?




macbook2:~ eric$ host ns1.automotiveparts.cz
Host ns1.automotiveparts.cz not found: 3(NXDOMAIN)


macbook2:~ eric$ host ns2.automotiveparts.cz
Host ns2.automotiveparts.cz not found: 3(NXDOMAIN)


macbook2:~ eric$ dig ns1.automotiveparts.cz

; <<>> DiG 9.6-ESV-R4-P3 <<>> ns1.automotiveparts.cz
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 2965
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;ns1.automotiveparts.cz. IN A

;; Query time: 892 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Sat Feb 4 11:39:25 2012
;; MSG SIZE rcvd: 40


I have only 1 public static IP. I also have not defined secondary DNS server. Only primary as you can see from config files.

EDIT: Btw I red article.



IMPORTANT: some cable modem and DSL ISPs do not allow DNS servers at home. If this is the case, traffic on port 53 will be filtered, and it will not be possible to run your own DNS server. Changing the port number will not help you, because other computers have no way of knowing you are running DNS on a nonstandard port. If this is the case for your ISP, find a better ISP, upgrade to a business-class connection without restrictions, or use the freedns.afraid.org service described above.
So this might be a problem ? My provider is Telefonica O2 and as mentioned I have classic ADSL cable conneciton.


EDIT2: anyway if you check config files, is there anything wrong at first sight?

volkswagner
February 4th, 2012, 06:05 PM
This is above my skill set.

I must ask why would you even want to run a public DNS from home?

The only way I could see this could work, is to change your whois. Change ns1.automotiveparts.cz to your public ip address.

arrrghhh
February 4th, 2012, 09:12 PM
I must ask why would you even want to run a public DNS from home?

This ^^. Especially if you suspect your ISP is blocking it... Does your registrar not allow you to setup DNS thru them...?

fuzzi
February 4th, 2012, 10:13 PM
This ^^. Especially if you suspect your ISP is blocking it... Does your registrar not allow you to setup DNS thru them...?

U are right gyus. Its nonsense to host DNS myself. My registar can host DNS of source and everything work fine now.

arrrghhh
February 4th, 2012, 11:00 PM
U are right gyus. Its nonsense to host DNS myself. My registar can host DNS of source and everything work fine now.

Glad you got it resolved ;).