LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Can i set up a dns server if i don't have registered domain? (https://www.linuxquestions.org/questions/linux-server-73/can-i-set-up-a-dns-server-if-i-dont-have-registered-domain-811474/)

cola 06-01-2010 08:42 AM

Can i set up a dns server if i don't have registered domain?
 
Can i set up a dns server if i don't have registered domain?

pixellany 06-01-2010 08:48 AM

Every dns server I have ever used has only a numerical IP (no domain name). Has your experience been different?

cola 06-01-2010 08:58 AM

Quote:

Originally Posted by pixellany (Post 3988674)
Every dns server I have ever used has only a numerical IP (no domain name). Has your experience been different?

No.
If you notice the zone file:
Code:

$TTL 3600
@ IN SOA ns1.example.com. dns-blr2.example.com. (
    2010053101 ; Serial 4char year 2mm 2dd 2vv
    10800 ; REFRESH
    10800 ; retry after 3 hours which forces it on the slave
    604800 ; expire after 1 week
    86400 ) ; minimum TTL of 1 day

    IN NS ns1
    IN NS ns2

ns1            IN A 10.76.15.121
noc-t2k-01 IN A 10.76.15.72
noc-t1k-03 IN A 10.76.15.119
noc-t1k-05 IN A 10.76.15.122

Code:

noc-t2k-01.example.com IN A 10.76.15.72
noc-t1k-03.example.com IN A 10.76.15.119
noc-t1k-05.example.com IN A 10.76.15.122

This "noc-t2k-01.example.com" is assigned a static ip address.
So what is this "noc-t2k-01.example.com"?
Isn't a registered domain name?
If we do:
Code:

dig www.google.com
Code:

; <<>> DiG 9.7.0-P1 <<>> www.google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 34531
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 4, ADDITIONAL: 4

;; QUESTION SECTION:
;www.google.com.                        IN        A

;; ANSWER SECTION:
www.google.com.                39488        IN        CNAME        www.l.google.com.
www.l.google.com.        110        IN        A        209.85.229.99
www.l.google.com.        110        IN        A        209.85.229.104
www.l.google.com.        110        IN        A        209.85.229.147

;; AUTHORITY SECTION:
google.com.                34932        IN        NS        ns1.google.com.
google.com.                34932        IN        NS        ns2.google.com.
google.com.                34932        IN        NS        ns3.google.com.
google.com.                34932        IN        NS        ns4.google.com.

;; ADDITIONAL SECTION:
ns1.google.com.                34947        IN        A        216.239.32.10
ns2.google.com.                244746        IN        A        216.239.34.10
ns3.google.com.                20662        IN        A        216.239.36.10
ns4.google.com.                20889        IN        A        216.239.38.10

;; Query time: 5 msec
;; SERVER: 114.31.0.66#53(114.31.0.66)
;; WHEN: Wed Jun  2 01:55:51 2010
;; MSG SIZE  rcvd: 236

www.google.com. is the canonical name of www.l.google.com. and it is assigned a static ip address.
Code:

www.l.google.com.        110        IN        A        209.85.229.99
www.google.com is registered.

pixellany 06-01-2010 09:04 AM

I'm not familiar with everything you just posted, but none of it seems to answer your original question.

If I tell my system to go to--eg--192.168.1.1 to do DNS lookup, why would I need to have a domain name assigned to that IP?

chrisgti 06-01-2010 09:51 AM

I think you are both on different wavelengths here.

Cola - your question is rather vague - can you be more specific? What are you trying to achieve? You don't have to own a .com address to run a DNS server, if that is what you mean. You could for example have an internal domain "myhouse.local" - you don't have to have this registered anywhere.

then you could have 3 PC's...pc1.myhouse.local, and so on. For each PC you would have an A record within the BIND Zone File for myhouse.local, eg:

pc1.myhouse.local. IN A 192.168.1.1
pc2.myhouse.local. IN A 192.168.1.2

and so on..

If PC1 tries to ping hostname PC3, the myhouse.local nameserver resolves the name with an authoritative response.

If the PC's in the internal domain used this DNS server and requested an address for which the DNS server has no entry it will be forwarded to an external DNS server. This can be done with forwarders or by using the root.hints file.

In the example zone file you posted "noc-t2k-01.example.com" is a host (note that it is an A record).

Often these are used for websites, for example.

If I am stating the obvious, I apologise.

cola 06-01-2010 10:00 AM

Quote:

Originally Posted by chrisgti (Post 3988736)
I think you are both on different wavelengths here.

Cola - your question is rather vague - can you be more specific? What are you trying to achieve? You don't have to own a .com address to run a DNS server, if that is what you mean. You could for example have an internal domain "myhouse.local" - you don't have to have this registered anywhere.

then you could have 3 PC's...pc1.myhouse.local, and so on. For each PC you would have an A record within the BIND Zone File for myhouse.local, eg:

pc1.myhouse.local. IN A 192.168.1.1
pc2.myhouse.local. IN A 192.168.1.2

and so on..

If PC1 tries to ping hostname PC3, the myhouse.local nameserver resolves the name with an authoritative response.

If the PC's in the internal domain used this DNS server and requested an address for which the DNS server has no entry it will be forwarded to an external DNS server. This can be done with forwarders or by using the root.hints file.

In the example zone file you posted "noc-t2k-01.example.com" is a host (note that it is an A record).

Often these are used for websites, for example.

If I am stating the obvious, I apologise.

I have only one pc/machine.
How would this domain be "myhouse.local" made?
I want to set up a dns server on my pc.

ComputerErik 06-01-2010 07:57 PM

Do you want to do DNS for an internal domain (which as covered doesn't need to be a publicly registered domain)? Basically the simplest thing to do if you only have a single PC is setup BIND and only a root hints zone file.

If you do want to resolve internal hosts just pick some random domain for the computers internally to use, and setup the forward lookup zone file. Might as well do the reverse too if you go through the trouble of setting up an internal server (not really that big of a deal IMHO).

Noway2 06-02-2010 08:51 PM

While it would be perfectly acceptable to set up a local domain, with only one PC I don't see a good reason to. If you want to name it, it would be easier to put an entry in your hosts file. One thing to consider is that you can run a DNS server and use that instead of your ISP for doing lookups. It has been my experience that the DNS service seems to be the most common item to go down on ISPs. There are quite a few good tutorials out there on this subject. Bind9 is pretty easy to setup. Take a look at these:
http://www.zaphu.com/2007/09/10/ubun...-server-setup/
and
http://lani78.wordpress.com/2008/08/...local-network/


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