DNS and static IP - how to?

I'm trying to define static IP's within DNS on Linux. I believe I've done it "by the book", litterally - I've followed the examples in  the O'Reilly Nutshell book: "DNS and Bind". I have a very simple initial configuration for testing with no DHCP.

I've created the domain "labrat", which consists of a Linux slackware 14.1 host with 2 NICs. One NIC is connected to the Internet, the other is connected to the LAN 192.168.0.0./24. On the LAN I have one device, a network print spooler with a fixed IP of 192.168.0.10. I'd like to assign this IP to the hostname "Ricoh". My configuration shown below is not working:
$ host ricoh
ricoh.labrat has address 198.105.244.228
ricoh.labrat has address 198.105.254.228
Host ricoh.labrat not found: 3(NXDOMAIN)

$ host ricoh.labrat
ricoh.labrat has address 198.105.244.228
ricoh.labrat has address 198.105.254.228
Host ricoh.labrat not found: 3(NXDOMAIN)

Open in new window

For one thing, I'm rather confused as to where the 198.105.244.228 IP is coming from. I must have something set up terribly wrong.  `named-checkconf -zp` shows no errors. named is running. Here are my files:

/etc/hosts
127.0.0.1               localhost
12.34.56.78           viao.labrat

Open in new window

/etc/named.conf
options {
        directory "/var/named";
        forwarders {            // These are the ISP provided name servers
            209.18.47.61;
            209.18.47.62;
        };

        allow-query {           // Permit querying by others in the domain
            192.168.0.0/24;
            127.0.0.1;
        };

};

zone "localhost" IN {
        type master;
        file "db.local";
};

zone "127.in-addr.arpa" IN {
        type master;
        file "db.127";
};

zone "labrat" in {
    type master;
    file "db.labrat";
};

zone "0.168.192.in-addr.arpa" in {
    type master;
    file "db.192.168.0";
};

Open in new window

/var/named/db.labrat:
$ORIGIN .
$TTL 4H
labrat              IN SOA  viao.labrat. postmaster.labrat. (
                                100     ; serial
                                3H      ; refresh (3 hours)
                                1H      ; retry (1 hour)
                                8H      ; expire (1 week)
                                1H      ; minimum (1 hour)
                                )
                        NS      viao.labrat.
$ORIGIN labrat.
$TTL 4H
viao                    A       192.168.0.1
ricoh                   A       192.168.0.20

Open in new window

/var/named/db.192.168.0
$ORIGIN .
$TTL 4H
0.168.192.in-addr.arpa  IN SOA  viao.labrat. mfoley.novatec-inc.com. (
                                100     ; serial
                                3H      ; refresh (3 hours)
                                1H      ; retry (1 hour)
                                8H      ; expire (1 week)
                                1H      ; minimum (1 hour)
                                )
                        NS      viao.labrat.

$ORIGIN 0.168.192.in-addr.arpa.
$TTL 4H
2                       PTR     viao.labrat.
20                      PTR     ricoh.labrat.

Open in new window

Note that I've tried with and without the root zone in named.conf:

zone "." IN {
        type hint;
        file "caching-example/named.root";
};

Help ...
LVL 1
MarkAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

arnoldCommented:
Static IP allocation is done on DHCP server. Within DNS you would create host to ip mapping.


I am unclear what you want to do.

The issue with you using forwarders and possibly search domains that leads/blends the query that bleads out leading to you getting a response different than what you expect.


Host -c labrat.

Host ricoh.labrat.
MarkAuthor Commented:
Static IP allocation is done on DHCP server. Within DNS you would create host to ip mapping.
Not doing DHCP. This spooler device does not have DHCP option for getting IP.

I thought I did the DNS host to IP mapping with the A record for "ricoh" in /var/named/db.labrat and the PTR record in /var/named/db.192.168.0. What am I missing?
I am unclear what you want to do.
Well, I thought I had a pretty stripped-down scenario. I want the Linux host to be the DNS server for hosts on the 192.168.0.0/24 LAN. One of those "hosts" is the print spooler at 192.168.0.10 to which I would like to give the LAN-resolvable hostname "ricoh".
The issue with you using forwarders and possibly search domains that leads/blends the query that bleads out leading to you getting a response different than what you expect.
I understood that was how offsite name resolution was supposed to work, "If you designate one or more servers at your site as forwarders, your name servers will send all their off-site queries to the forwarders first." [O'Reilly "DNS and Bind", 4th ed. pg 266, 'Forwarding']

`host -c labrat' gives:
$ host -c labrat
host: invalid class: labrat

Open in new window

So, what are you recommending I should do?
arnoldCommented:
You need to terminate labrat in the query to make sure it is not bleeding out to the forwarder
host -c labrat. <==== e ending period is part of the line entry.

When you made changes to the DB.kabrat file did you reconfigure/reload named.

Your named.conf is not showing an Entry dealing with the option to use the rndc reconfig
Or rndc reload labrat.
What is the output of "dig @localhost axfr labrat."?
Webinar: Cyber Crime Becomes Big Business

The rising threat of malware-as-a-service is not one to be overlooked. Malware-as-a-service is growing and easily purchased from a full-service cyber-criminal store in a “Virus Depot” fashion. Join us in our upcoming webinar as we discuss how to best defend against these attacks!

Neil RussellTechnical Development LeadCommented:
ALSO....

"On the LAN I have one device, a network print spooler with a fixed IP of 192.168.0.10. I'd like to assign this IP to the hostname "Ricoh"."

BUT YOU HAVE....
ricoh                   A       192.168.0.20

10 <> 20
arnoldCommented:
Your forwarders return the IP 198.105.244.228 which is a DNS search tool. Meaning those forwarders whenever a non existent domain (nxdomain) request comes in redirect the user to the dnssearch.com (via IP 198.105.244.228)
MarkAuthor Commented:
You need to terminate labrat in the query to make sure it is not bleeding out to the forwarder
host -c labrat. <==== e ending period is part of the line entry.
Sorry, missed that in your initial post. Added the '.' same result:
$ host -c labrat.
host: invalid class: labrat.

Open in new window

When you made changes to the DB.kabrat file did you reconfigure/reload named.
yes.
Your named.conf is not showing an Entry dealing with the option to use the rndc
Actually, never heard of or dealt with this before. I'll research. Is it something I need?
BUT YOU HAVE....
ricoh                   A       192.168.0.20
10 <> 20
Duh! I am an idiot! OK, I've changed the zone files to be .10. Still, I would expect the ricoh hostname to resolve to 12.168.0.20, even if the device were unreachable at that IP.
What is the output of "dig @localhost axfr labrat."?
$ dig @localhost axfr labrat.

; <<>> DiG 9.9.5-P1 <<>> @localhost axfr labrat.
; (1 server found)
;; global options: +cmd
labrat.                 14400   IN      SOA     viao.labrat. postmaster.labrat. 100 10800 3600 28800 3600
labrat.                 14400   IN      NS      viao.labrat.
ricoh.labrat.           14400   IN      A       192.168.0.10
viao.labrat.            14400   IN      A       192.168.0.1
labrat.                 14400   IN      SOA     viao.labrat. postmaster.labrat. 100 10800 3600 28800 3600
;; Query time: 4 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Thu May 07 19:51:15 EDT 2015
;; XFR size: 5 records (messages 1, bytes 164)

Open in new window

Your forwarders return the IP 198.105.244.228 which is a DNS search tool.
OK, makes sense. I've seen that in browers before when I foop an address.
matrix8086Commented:
Did you set 192.168.0.1 as DNS on the workstation where you made the tests? I will hazard to say no! :) And that workstation, at host command, sends DNS requests to another DNS (an external one probably) about the domain .labrat, insteat of requesting the internal DNS that you've just configured.

Best regards!

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MarkAuthor Commented:
Well, that's two idiot things I've done on this "simple" configuration, proving I need EE help! I posted all my config files except /etc/resolv.conf, and you are exactly right; I had the ISP's name servers in there. I changed /etc/resolv.conf to:

domain labrat
search labrat
nameserver 192.168.0.1

and now `host ricoh` gives:

ricoh.labrat has address 192.168.0.10

Lastly, I will connect another workstation to this mini-LAN to verify other LAN members can resolve ricoh. I'll post back results.
MarkAuthor Commented:
OK, things are working. I had done this successfully in the past and couldn't figure out what my problem was. Just a couple of stupids I needed another pair of eyes to find!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
DNS

From novice to tech pro — start learning today.