Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660
Rep:
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.
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.
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660
Rep:
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???
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660
Rep:
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)".
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.
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660
Rep:
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.