• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 412
  • Last Modified:

Setting up a DNS Server with Cable Modem

I have a cable modem thru @home. Running RH6.2. I have a static IP address so I want to make the linux box a DNS server.  My question is: when setting up the cable modem for linux, I had to change  the hostname of the box to the one supplied by @home. I don't think I can change it.  I wanted to name it dns1@mydomain.  I have 2 NIC cards in the linux box, one for the cable connection(outside) and one for the internal network( I am using IP masq so my other Win boxes can connect).  What are my options?  Can I give the box 2 hosts names. Is there a way I can change the hostname back to dns@mydomain without losing my connection? If you need more details, let me know.

  • 6
  • 4
1 Solution
If you have 2 ethernet cards, you can give your box two names(one for each). That way, you'll be known through one name for your inside and through @home's to the outside(internet). I did all this through Linuxconf so that's what I'd recommend. You could also do it through netcfg. You have to keep the name that @home gave you to the outside, because that's how your machine is identified by their DNS server. Also make sure your firewall is secure.
You can have multiple aliases for the hostname
had to assign to your box. The the cable modem's IP has nothing to do with the hostname they
originally assigned ... unless you specifically
need to resolve off of *that* name for some reason.

You can register @mydomain with Network Solutions,
tell them the ip address of your primary dns server (your static) and then when you setup your dns you can put whatever CNAME alias records in the forward file you want. In fact internet dns
servers are typically aliased to whatever the actual hostname is as dns.mydomain.com (and if it's the web server as www.mydomain.com, and if it's the smtp gateway as smtp.mydomain.com, etc.).

Of course you should keep in mind that setting up your own services on a residential contract with @home may be a violation of that agreement.

jkipp_66Author Commented:
I am still confused.
I already have 2 different names assigned to the NIC cards.  But even in my internal network the box is still seen as CNXXXX (the @home name). Looking at linuxconf, it seems as though you can assign different names to the cards, but the box hostname remains the same.  I want to use the public Static IP address as my DNS server. I already have a registered domain name and I want to replace the primary DNS server with my own (24.40.xx.xxx is the static IP and dns1.mydomain.com)
So should I just keep the CNXXXX hostname and specify a different name in DNS? According to the DNS howto the SOA record must be an actual machine, can't be a CNAME.  Is there any better DNS tutorials out there? The DNS howto really does not explain much.
In which file do I actually specify the domain that I registered? In named.conf, or the zone files? Also I did not see anything about a forward file in the DNS Howto.

Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

Ok, let's se if I can explain this properly. The host names that @home
assigned to your static are just fine. They won't have any real relevance to
you running your own dns.  When someone on the internet wants to get to
bozo.clown.com the query goes to their dns, then to the internic root
servers, which will (if you've sent them the proper forms) answer that
dns queries for clown.com can be answered (authoritatively) by
the ip address of dns.clown.com.

dns.clown.com is running a dns server and "dns" is aliased (CNAME) to
the local host that is actually running the name service,
 ie. the @home hostname and static ip you've been assigned.

There are 4 parts to the dns files.

named.conf - defines the zone of authority
the forward hosts file - defines the hostname to ip address info
the reverse lookup file - defines the ip to host info
the statement of authority (soa) - defines variables that control the                                                            storage of zone info (refresh,retry,etc.)

You will need to make the internic aware of the ip address for your
primary dns server once all the dns is in place, running and can
resolve locally correctly ... once the root servers at the inetrnic have updated their info (within 24hrs usually) everyone else will be able to
resolve your domain correctly.

So, go to www.isc.org ... follow the bind examples to get a basic
named.conf  built, forward, rev files and soa. get named running ....
use nslookup to make sure you can resolve ok then update the
internic forms.

I f you want to really learn about how dns works the O'Reilly book
on DNS and BIND is excellant. getting your own dns server going
at home with your own domain name is great experience ...

jkipp_66Author Commented:
Adjusted points from 200 to 250
jkipp_66Author Commented:
I did some more research. I am aware of the book "dns-bind" and I will get it when I can afford it.  Because I want to ask a few more questions before closing out, I have increased the points to 250.
Here are my questions:

1. /etc/resolv.conf:
Do I need the  nameserver, Do I put the actual 24.40.xx.xxx or both?
Can I still put my ISP name servers in there?
2. in /etc/named.conf
The stuff already there is for a caching only name server. Should I just leave that stuff in and add my zone file to it?
3. in named.local:
Do I use the localhost as the SOA or should I put the actual dns1.mydomain.com there?
4. named.forward
is this where I actuall specify the NS, how is this different than the zonefile? would the below be correct:
local host  A
ns            A    24.40.xx.xxx
www        CNAME24.40.xx.xxx
mail         CNAME 24.40.xx.xxx
does it matter what I put in the serial number line? Is this my zone file or do I need another one?
5. In  named.xx.40.24 - the reverse name file
I am confused on what a PTR record actually does.
6. I  noticed that is the zone files and forward files in the examples they used A names for the same box with names mail, dns, linuxhost (all in .mydomain.com.) shouldn't these be CNAME?

That is it, Thank You.

1. Put the actual ineternet registered IP address. In reality, you don't
    *need* a resolv.conf unless you plan to be on the dns server box and
    want to do name resolution ... run nslookup for instance.

2. You don't want to do a caching only server because this is a
    primary for your domain.  The basic template should look like ...

options {
                           directory "/var/named";

zone "isc.org" in {
                           type master;
                           file "master/isc.org";

zone "." in {
                           type hint;
                           file "named.cache";

zone "0.0.127.in-addr.arpa" in {
                           type master;
                           notify no;
                           file "master/127.0.0";

3.  dns1.mydomain.com

4.  One thing that might be helpful is to understand that the forward,
     reveserse and SOA info could all be in one file. At a large site this
     is harder to admin so historically things are split up. The SOA info
     could go into a seperate file say named.soa, and yes the NS records
     can (typically) go in there. Or  some sites copy the entire SOA info
     into the top of the forward and reverse files. I prefer to maintain
     soa in a seperate file for large sites simply because I only need to
     edit the serial number in one file and HUP named after I make a
     change to the ip object info. For now I suggest putting the soa info
     at the top of each file. If you add a machine you make and entry in
     the forward file, the reverse file, change the serial number in each to
     match (increment) and HUP named. Yes, typically the NS records are
     stored just under the soa info ... in this case it would be in each file.
     You can put any number in for the serial number. We used to put
     something like 19980501.1  and increment the date and last digit
     if many chages were made during the day. Nowadays with dynamic
     dns changes being made from dhcp servers, I start a new dns server
     with "1" and let it go from there.

5. An (A)dress record is a name to address record. A (P)oin(T)e(R)
    record is the format resolver functions use to get address to name.

6. Either way works. As you get more into this you'll learn there are more     than one way that will work ok. I prefer to assign one ip address per
    object (there is an exception to that tho!) and CNAME the aliases I
    want going to the same machine.

Sounds like you're almost there!
jkipp_66Author Commented:
Adjusted points from 250 to 275
jkipp_66Author Commented:
Everything seems to be working, just a couple more questions before I close this out (gave you another 25 pts) :

1) in the zone sections of /etc/named.conf, what does 'notify no' mean?
2) in the zone files:
1997022700 ; Serial
 8H        ; Refresh
 2H        ; Retry
 1W        ; Expire
 1D   )    ; Minimum

What do refresh, retry, expire, minimun mean? Are the values in Hex?

Thanks for all your help.
1)It means not to notify a secondary server for the zone that a change has
   occurred on the primary, and that a zone xfer is needed for the secondary to
   have the current information.

2) These will generally be specified in seconds ...

REFRESH  time interval before the zone should be
                 refreshed (reread the master files). If your setup
                 is pretty static you can make this large.

RETRY      time interval that should elapse before a
                 failed refresh should be retried.

EXPIRE     time value that specifies the upper limit on
                the time interval that can elapse before the zone is no
                longer authoritative.

MINIMUM  minimum TTL field that should be
                exported with any RR from this zone. If a query is cached
                by another site it'll be good for at least this time period.

Try this  to start ... it's pretty statndard. If your info never changes there's no
point in having named reread the files every 2 hours, so up it.

7200            ; Refresh [2h]
1800            ; Retry   [30m]
259200        ; Expire  [3d]
86400 )        ; Minimum [1d]

Watch your syslog file when you start up named ... it should let you know if
there are any syntax errors (assumming you have syslogd running and
configured of course).

jkipp_66Author Commented:
Thanks for all your help. My DNS Server si set.
Next I will be setting up a Mail Server. You may see me post again.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

  • 6
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now