Setting up a DNS Server with Cable Modem

Posted on 2000-05-01
Last Modified: 2010-03-18
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.

Question by:jkipp_66
  • 6
  • 4

Expert Comment

ID: 2766791
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.

Accepted Solution

unixway52 earned 275 total points
ID: 2767523
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 (and if it's the web server as, and if it's the smtp gateway as, 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.


Author Comment

ID: 2771360
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 ( is the static IP and
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.

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.


Expert Comment

ID: 2771867
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 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 can be answered (authoritatively) by
the ip address of 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 ... 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 ...


Author Comment

ID: 2782581
Adjusted points from 200 to 250

Author Comment

ID: 2782582
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 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 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
mail         CNAME
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 shouldn't these be CNAME?

That is it, Thank You.


Expert Comment

ID: 2782850
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 "" in {
                           type master;
                           file "master/";

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

zone "" in {
                           type master;
                           notify no;
                           file "master/127.0.0";


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!

Author Comment

ID: 2798295
Adjusted points from 250 to 275

Author Comment

ID: 2798296
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.

Expert Comment

ID: 2798509
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).


Author Comment

ID: 2802172
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.

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question