LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-14-2006, 03:21 PM   #1
trebek
Member
 
Registered: Feb 2005
Location: Costa Rica
Distribution: Ubuntu, gOS, Debian & Slack 12
Posts: 426

Rep: Reputation: 30
named and subdomain


Hi everyone.

I am attempting to add a new domain to my named configuration; this domain also has a subdomain, and i have to add the www part. Here's what i have done so far:


This part is from the '/etc/named.conf' file:

Code:
zone "thesite.com" IN {
        type master;
        file "thesite.dns";
};
Then, in '/var/named' i created a file called 'thesite.dns', where i put all the other stuff. My question is, how do i add a subdomain (call it sdomain) and the www part to this file?

Code:
;
;  Database file thesite.dns for thesite.com zone.
;
 
@                       IN  SOA penguin1.intranet. . (
                                3          ; serial number
                                3600        ; refresh
                                600         ; retry
                                86400       ; expire
                                3600      ) ; minimum TTL
 
;
;  Zone NS records
;
 
@                       NS      intranet.
@                       NS      penguin1.intranet.
 
;
;  Zone records
;
 
@                       A       192.168.210.200
@                       MX      10      mailhost
By the way, if you find out that this is not resolving either to the domain, be sure to let me know. Thanks a lot in advanced.

Last edited by trebek; 11-14-2006 at 03:29 PM.
 
Old 11-14-2006, 03:58 PM   #2
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
Are you sure you mean sub-domain? Are you saying that www is the sub-domain to thesite.com, or are you saying you need to add the record for the www host in addition to a sub-domain?

In any case, you would add www like this, right below the line that has MX on it:
Code:
www                 A        192.168.210.whatever the last octet is
For the sub-domain, do you need to delegate it to another name server, or is this name server authoritative for the sud-domain? If this name server is authoritative, then you don't need to do anything special. Just make sure you append the sub-domain to the end of any host, such as:

Code:
somehost.sub-domain    A       192.168.210.some other octet
If you need to delegate it, I can give an example.

By the way, where are your A records for intranet and penguin1.intranet? They need A records, just like my www example above. For that matter, so does mailhost.
 
Old 11-14-2006, 04:11 PM   #3
trebek
Member
 
Registered: Feb 2005
Location: Costa Rica
Distribution: Ubuntu, gOS, Debian & Slack 12
Posts: 426

Original Poster
Rep: Reputation: 30
Ok, for the www, i think i'm all set. I did a nslookup, and it threw me to the same ip where it is served, having the named thrown with www.thesite.com. So i guess that part's done.

Now, i am not sure what you are asking for the sub-domain or the A records for intranet and the other. I guess i just need the sub-domain to be pointed to the same place as the domain is. And yeah, go ahead and put the examples, i might understand a little bit better what you are trying to say.
 
Old 11-14-2006, 04:32 PM   #4
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
Code:
intranet                 A   192.168.210.???
penguin1.intranet        A  192.168.210.???
mailhost                 A  192.168.210.???
penguin1.intranet is an example of a host in a sub-domain. The sub-domain is intranet.thesite.com. The notation you're using is shorthand. Really, if it was all written out it would be:
intranet.thesite.com.
penguin1.intranet.thesite.com.
mailhost.thesite.com.
etc...

Also, the Resource Records for NS and MX just tell other hosts where to look for the IPs of your DNS servers and Mail eXchanger, respectively. You still need to list the A record that converts the name to an IP address. Just having the NS or MX record alone isn't enough. How is anyone supposed to find out the IP address of mailhost.thesite.com???
 
Old 11-14-2006, 04:46 PM   #5
trebek
Member
 
Registered: Feb 2005
Location: Costa Rica
Distribution: Ubuntu, gOS, Debian & Slack 12
Posts: 426

Original Poster
Rep: Reputation: 30
So, if i had the sub-domain called 'subdomain' and the domain thesite.com, my entries should be:

Code:
subdomain.thesite.com    A   192.168.210.???
 
Old 11-14-2006, 04:58 PM   #6
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
Do you understand what a sub-domain is, though? DNS doesn't really make a distinction unless you delegate the authority for a particular sub-domain to another set of servers.

subdomain.thesite.com could be a hostname. You can also have hosts called thing1.subdomain.thesite.com, thing2.subdomain.thesite.com, etc... in that case thing1 and thing2 would be considered "hosts in the subdomain: subdomain.thesite.com", but really there's nothing special about it. subdomain.thesite.com itself could be a hostname. The only thing you have to do in your zone file is to remember to attach subdomain to the end of the host, like: thing1.subdomain It will automatically append the domain unless you end subdomain with a . In DNS, a dot at the far right indicates the "root", i.e. the beginning of everything. That's why if you miss putting a period in certain places, it's a "Very Bad Thing(tm)".
 
Old 11-15-2006, 01:28 AM   #7
trebek
Member
 
Registered: Feb 2005
Location: Costa Rica
Distribution: Ubuntu, gOS, Debian & Slack 12
Posts: 426

Original Poster
Rep: Reputation: 30
I believe you are making quite a strong point here. Let me study and research a bit further and deeper on DNS and named theory, and i promise i won't be asking any more silly questions. I do know the theory on DNS, a little bit, but the way the configuration is handled on those named .dns files, just makes it harder to understand and mixes them a lot. I'll be sure to post back when i do know a bit more about that. In the meantime, please help me find a really good tutorial about this, cause i've been googling all day long and i haven't found much info.

Thanks for the help though dude. I tested what you help me do, and i got all 3 responses
thesite.com
www.thesite.com
subdomain.thesite.com
pointed right, using the nslookup command i found while googling. You rock man.

Last edited by trebek; 11-15-2006 at 02:22 AM.
 
Old 11-15-2006, 02:00 AM   #8
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
DNS is very confusing, especially with BIND. The syntax is extremely cryptic. I would have to vote the BIND zone files as the worst config file format ever, but I guess it made sense to someone...

The trick with sub-domains is that they don't really exist at all as distinct domains, unless you delegate them to another name server. i.e. you say "this sub-domain is inside my domain, but my name servers don't know about it, so here's a list of name servers that do know about it". Any host can have it's own MX record, for instance, so just having some of the "special" resource records doesn't make a particular entry a "sub-domain". It's really just how people choose to talk about hostnames with multiple components, it's not a technical distinction.

I know people ask for DNS HOW-TOs all the time, so I'm guessing there aren't that many good ones out there (it's been a while since I've looked). Honestly, the book DNS and BIND by Albitz & Liu is probably your best bet.
 
Old 11-15-2006, 02:26 AM   #9
trebek
Member
 
Registered: Feb 2005
Location: Costa Rica
Distribution: Ubuntu, gOS, Debian & Slack 12
Posts: 426

Original Poster
Rep: Reputation: 30
I'll look it up as soon as i can; and probably end up getting it over the internet. But yeah, there isn't much literature about named. I usually find everything i need using google, and i've been impressed over this; almost nothing but some crappy examples on a very particular use of these files and named. But hey, friend, you have helped me a lot. At least i got something working and probably i'll build up my knowledge from there. I think i got a very rough idea of what i should be looking for, i guess i have a lot of reading to do.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Subdomain->IP? johndmann Linux - Networking 5 04-03-2006 04:09 AM
named -u named at startup zzero Linux - Newbie 4 03-16-2004 12:08 AM
cannot find named.conf and /var/named kaushikma Red Hat 1 02-07-2004 12:49 PM
Virtual Host type, named or IP via SSL? Named VH is not possible? piratebiter Linux - Security 3 08-20-2003 05:27 PM
Subdomain help DoobyWho Linux - General 3 04-14-2003 06:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration