LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   configure dns server to point correct ip to your website (https://www.linuxquestions.org/questions/linux-server-73/configure-dns-server-to-point-correct-ip-to-your-website-842851/)

piyusharora420 11-07-2010 05:36 AM

configure dns server to point correct ip to your website
 
i have made a website and i want to use it in my lan.it is working with ip address but i want to use name convention.dns server is working correctly.my server ip is 192.168.0.254
and sample website is www.vinita.com
computers in my lan can open it using http://192.168.0.254
but not by http://www.vinita.com
please tell me what things i need to edit in named.conf file and in forward zone and reverse zone files?
i am using rhel5.please help me

bathory 11-07-2010 08:08 AM

Hi,

You should have posted named.conf and the zone file.
Anyway, assuming that the zone vinita.com is already defined in your name server, all you need to add is:
Code:

www IN A 192.168.0.254
and
Code:

254 IN PTR www.vinita.com.
in forward and reverse zone respectively.

Regards

piyusharora420 11-07-2010 11:34 PM

below is my reverse zone file 0.168.192.in-addr


$TTL 86400
@ SOA www.vinita.com. root.www.vinita.com. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum

IN NS www.vinita.com
254 IN PTR www.vinita.com.
1 IN PTR client1.
2 IN PTR client2.



below is my forward zone file www.vinita.com.zone

$TTL 86400
@ SOA www.vinita.com. root (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum

@ NS www.vinita.com.
www.vinita.com. MX 10 www.vinita.com.
@ NS client1.client.com.
client1 A 192.168.0.1
client2 A 192.168.0.2
www A 192.168.0.254



the file below is named.conf

options{
directory "/var/named/";
};

zone "example.com" {
type master;
file "example.com.zone";
allow-transfer {192.168.0.1;};
};
zone "0.168.192.in-addr.arpa" {
type master;
file "0.168.192.in-addr.arpa.zone";
};

zone "www.vinita.com" {
type master;
file "www.vinita.com.zone";
allow-transfer {any ;};
};
zone "0.168.192.in-addr" {
type master;
file "0.168.192.in-addr.zone";
"named.conf" 23L, 466C



please edit it correctly for me.thank you very much

bathory 11-08-2010 12:29 AM

Hi,

The zone name in named.conf is wrong (www.vinita.com instead of vinita.com). So you need:
Code:

...
zone "vinita.com" {
type master;
file "www.vinita.com.zone";
allow-transfer {any ;};
};

The last reverse zone (zone "0.168.192.in-addr") definition is wrong and it's not needed at all.
Re: zone files, in reverse zone you miss:
Code:

$TTL 86400

@ SOA www.vinita.com. root.www.vinita.com. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum

IN NS www.vinita.com. ;miss the trailing dot here
254 IN PTR www.vinita.com.
1  IN PTR client1.vinita.com.
2  IN PTR client2.vinita.com.

In forward zone:
Code:

$TTL 86400
@ SOA www.vinita.com. root (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum

@ NS www.vinita.com.
@ MX 10 www.vinita.com. ;Use @ or vinita.com.
@ NS client1.client.com.
client1 A 192.168.0.1
client2 A 192.168.0.2
www A 192.168.0.254

Don't forget to increase the serial after changing the zone files and then reload/restart named.

piyusharora420 11-08-2010 01:46 AM

You are a genius.It works.
Thanx alot.
sir i dont the meaning of NS PTR IN MX 10 @ .at the last
could you please tell me what are these things because i want to learn it from not.i don't want to cram.

bathory 11-08-2010 02:07 AM

Glad to see it worked.
If you want to learn more about the various NS records, you should take a look here. Or read the whole book as there are some useful example configurations.

BTW you can mark the thread "Solved" using the "Thread Tools" on top of the page.

Regards


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