Fedora Linux Support Community & Resources Center
  #1  
Old 16th February 2009, 09:20 PM
adrianTNT Offline
Registered User
 
Join Date: Feb 2009
Posts: 9
Adding DNS A records

Hello, I have Fedora Core 8 and I want to host multiple domains using same dedicated IP address.
On my domain registar I set the NS to ns1.myserver.com ns2.myserver.com
I know that my domain needs an "A" record in order to be associated with my server.
I have some questions...

1. Where do I add the DNS "A" record on my server files? Is it /etc/named.conf ?
2. Any other file to edit?
3. Does server needs restart whenever I edit named.conf?
4. Is this correct format of an "A" record that is added?

Code:
zone "domain1.com" {
        type master;
        file "domain1.com";
        allow-transfer {
                my.ip.address.here;
                common-allow-transfer;
        };
};
Thanks in advance.
- Adrian.
Reply With Quote
  #2  
Old 17th February 2009, 03:44 AM
HSHAssociates Offline
Registered User
 
Join Date: Mar 2007
Age: 53
Posts: 27
All you have added is a zone to the named.conf THat is not an A record.

Look in the options section for the options for the directory variable, and look in there for the file you need to edit.
Add the A record in this format:

www.yourdomain.com. A 192.169.0.100

(You need a trailing . on a FQN, and substitute your ip addy and domain name for your setup)
Reply With Quote
  #3  
Old 17th February 2009, 10:35 AM
adrianTNT Offline
Registered User
 
Join Date: Feb 2009
Posts: 9
on a server where I have domains added the options area of /etc/named.conf looks like this:

Code:
options {
        allow-recursion {
                localnets;
        };
        directory "/var";
        auth-nxdomain no;
        pid-file "/var/run/named/named.pid";
};

// and here are zones formated as in my first post
I cannot locate the format you mentioned. Is it another file than /etc/named.conf? I seen that line format that you mentioned somewhere but don't know in what file.
Reply With Quote
  #4  
Old 17th February 2009, 02:35 PM
HSHAssociates Offline
Registered User
 
Join Date: Mar 2007
Age: 53
Posts: 27
It looks like the file domain1.com is located directly in the /var directory, if the options statement in your named.conf is correct. look for domain1.com and post the contents.
Reply With Quote
  #5  
Old 17th February 2009, 03:53 PM
adrianTNT Offline
Registered User
 
Join Date: Feb 2009
Posts: 9
I could do it by adding this:

in /etc/named.conf:
Code:
zone "domain1.com" IN {
        type master;
        file "domain1.com";
        allow-update { none; };
};
created /var/named-chroot/var/named/domain1.com:
Code:
$TTL    86400

@       IN      SOA     domain1.com. other.other.com. (
                        1997022700      ; Serial
                        10800   ; Refresh
                        3600    ; Retry
                        604800  ; Expire
                        10800 ) ; Minimum

domain1.com.              IN NS   208.109.209.186
domain1.com.              IN A    208.109.209.186
www.domain1.com.          IN CNAME        domain1.com.
domain1.com loads ok in browser now.
But...

Is there a way to simplify this? I don't know if adding the zone was needed or not.
Ideally I would like it to work for any domain so that I dont have to do this for all my domains. Is there a way?
Reply With Quote
  #6  
Old 17th February 2009, 04:27 PM
HSHAssociates Offline
Registered User
 
Join Date: Mar 2007
Age: 53
Posts: 27
Of course you need to add the zone.

You could get cpanel or plesk and do it through a gui inerface, but if you are going to be a sysadmin, these are some of the files you will have to create and maintain...
I do this for a couple of hundred domains, and it takes less than a minute to add a new zone.
Reply With Quote
  #7  
Old 17th February 2009, 04:33 PM
adrianTNT Offline
Registered User
 
Join Date: Feb 2009
Posts: 9
I will use this server as my own parking server and I will add few hundreds domains.
Maybe you know a good way to dynamically create these files?
Or I am thinking about redirecting the files to my server html root and create the files there by PHP.
Do you have hundreds of files inside /var/named-chroot/var/named/ for each domain?
Reply With Quote
  #8  
Old 17th February 2009, 05:16 PM
HSHAssociates Offline
Registered User
 
Join Date: Mar 2007
Age: 53
Posts: 27
I have one file per domain. Basically, when I create a new domain, I just copy olddomain.com to newdomain.com, and use a search and replace script to change the name (and ip address if necessary). Then I add an entry in the named.conf, rndc reload and away it goes. If you are running a slave server on another machine, you have to update the named.conf on the slave server as well. Same with my httpd.conf file. I use a vhosts.conf that I include at the end of httpd.conf, and add a virtual domain in there.
Reply With Quote
Reply

Tags
adding, dns, records

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
delete dup records in MySQL hiberphoptik Programming & Packaging 1 8th March 2006 01:18 AM
recording records? dave1918 Wibble 3 2nd April 2005 06:59 PM


Current GMT-time: 00:07 (Wednesday, 19-06-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat