Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to set up a DNS server (local). On a tutorial, it says this:

# This is the zone definition for reverse DNS. replace 0.168.192 with your network address in reverse notation – e.g my network address is 192.168.0

My ip address is 174.143.206.33

So, should I put: 216.143.174?

This is my ifconfig:

eth0      Link encap:Ethernet  HWaddr 40:40:4f:38:2c:c5
          inet addr:174.143.206.33  Bcast:174.143.206.255  Mask:255.255.255.0
          inet6 addr: fe80::4240:4fff:fe38:2cc5/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:68509 errors:0 dropped:0 overruns:0 frame:0
          TX packets:14299 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:98321989 (98.3 MB)  TX bytes:1282756 (1.2 MB)

eth1      Link encap:Ethernet  HWaddr 40:40:c8:3b:32:be
          inet addr:10.176.205.62  Bcast:10.176.223.255  Mask:255.255.224.0
          inet6 addr: fe80::4240:c8ff:fe3b:32be/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:230 (230.0 B)  TX bytes:510 (510.0 B)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
share|improve this question
    
What's your subnet mask? The answer depends on that. –  Jimmy Shelter Nov 9 '09 at 23:33
    
I have edited the question to include ifconfig, mh. –  Alex Nov 9 '09 at 23:37

3 Answers 3

up vote 1 down vote accepted

To calculate this, take your IP address and do a bitwise AND with the subnet mask, then reverse the octets that aren't zero.
i.e.

IP = 192.168.001.001
SM = 255.255.255.000
Net= 192.168.001.000

The result you would use in example is 1.168.192 for your PTR (reverse) subnet.

share|improve this answer

If "0.168.192" is the suggested name for a zone file, the name can be anything. You can in fact call it 174.143.206.0-24.zone or just about anything else, as long as you point to the correct file name in named.conf

I know there's this "fashion" to name the zone files in the reverse order but IMO it's just unintuitive.

share|improve this answer
    
I agree. Unless you're using some automated tool that requires otherwise, the zone file name should be easily understood by humans. The zone name has to be easily understood by machines, but we get to choose the file name. –  David Schwartz Oct 28 '11 at 1:03

I don't agree with Florin. Zone file names should have a meaning, this is basic good practice. Configuration file names should convene some information about their purpose.

Specifically in this case, since your IP is 174.143.206.33 and your netmask is 255.255.255.0, the reverse address would be 206.143.174.in-addr.arpa

This site has a very decent tutorial:

http://twiki.cpanel.net/twiki/bin/view/AllDocumentation/WHMDocs/RdnsForBind

Of course, if you're already following another tutorial, stick to that one.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.