Click to See Complete Forum and Search --> : Adding records to the domain name server


fedso
09-25-2002, 07:49 AM
Hi All,

I am having touble finding the domain name server file on the server where all the domain name records are kept. All I wanted to do is add a few more in there. I have just recently brought some new domain names and they are pointing at our name servers. I just need to add the records in.

I am very new to the linux server environment. The only commands I know at the moment is ls, cd and that is it. Pretty pathetic isn't it.

The version of linux I am running is I think Red Hat 7 (a friend installed it for me and he is usually the one supporting it). To connect to the machine I use a program called putty which allows me to log into the machine (using ssh I think). So this is all text based.

In summary, I just need to know the following:

How to locate the dns records file on the server.
How to open the file in putty.
How to add a new dns record (I can probably figure this one out if I can locate and open the file).

This all needs to be done through the program putty so I really need to know the commands for the above actions.

miteycasey
09-26-2002, 11:52 AM
I'm using a default format on RedHat 7.2. This is what is working for me.

There are two files that are important.
/etc/named.conf
the files in /var/named

my /etc/named.conf file is a text file full of my records.
example:

zone "localhost" {
type master;
file "localhost.zone";
};

Then the /var/named/localhost.zone file looks like this.
$TTL 86400
@ IN SOA @ root.localhost (
1 ; serial
28800 ; refresh
7200 ; retry
604800 ; expire
86400 ; ttl
)


@ IN NS localhost.


@ IN A 127.0.0.1

This is a basic layout.

My example that is in use.
where 'your' is ww.your.com
To add a record vi /etc/named.conf and add 4 lines.

zone "your.com" {
type master;
file "your.com.dns";
};

Then create a file named your.com.dns in /var/named.
That file will read:

$TTL 3600
@ IN SOA ns2.your.com. yourname.your.com. (
39982 ; serial number
3600 ; refresh
600 ; retry
86400 ; expire
3600 ) ; minimum TTL


@ IN NS ns2.your.com.
IN NS ns1.yourhost.net.
IN NS ns2.yourhost.net.


@ IN A xx.xxx.xx.xxx
@ IN MX 0 mail.your.com.
www IN A xx.xxx.xx.xxx
whatever IN A xx.xxx.xx.xxx

Note: the whatever above would link to whatever.your.com and of course you will need to replace the xx.xxx.xxx.xx with your ipaddress.

I hoped this helped. Bind can be a monster. GOOD LUCK!!!

fedso
09-26-2002, 09:45 PM
Thanks so much for that informative and yet clear post. I'll give that a go tonight.

Just one thing, what are the commands for the following actions:

opening a file (is it "vi")
saving a file
create a file


Sorry but I am really new to the whole linux environment.

miteycasey
09-27-2002, 12:12 AM
try searching www.google.com for 'vi commands'. There will be a more complete list.

In short.
'i' is insert.
'esc key' to exit insert mode.
':wq' to write and quit.
':q' to quit without writing.

if you mess up then you can ':q' and start over.

remember save often. :)

or is you are in xwindows open the files with emacs or another text editor.

options are limitless on how to do this.

fedso
09-27-2002, 09:57 PM
Ok, I just found out that I can't even connect to the name server, I think I need to connect to the web server first and then somehow connect to the name servers from there.

Basically, I am using the windows platform program called PuTTY to create a SSH connection o my web server. What I need to do is connect to the name server from here. I tried loging straight into the name server but I think is bouncing me back to the web server.

Any idea what I need to do to log into my name server so I can add some records to the named.conf file.

fedso
09-28-2002, 09:40 AM
Thanks for your help miteycasey.

I couldn't log into the name server because my friend have put the server on port 2222 SSH. But once I was logged in I just copied one of the other name records and changed the name to the one I am adding. Created the db.domainname directory and restarted the name server. Add a virtual directory to apache and bang, everything is perfect.

This is great.