Operating System - HP-UX
1833431 Members
3302 Online
110052 Solutions
New Discussion

Simple DNS server (using Native HP-UX BIND)

 
SOLVED
Go to solution
Richard Briggs
Regular Advisor

Simple DNS server (using Native HP-UX BIND)

I just want my HPUX server to serve up DNS info from my /etc/hosts file. I am on an isolated network.. and I don't want to update a bunch of /etc/hosts files around the network or share them out with NFS. I also have some routers on the network that I would like for this server to serve up DNS info to... is there just a simple way to use my hpux machine as a simple DNS primary server? The technical docs are confusing the heck outta me...
#find / -name coffee | cup < cream
19 REPLIES 19
Steven E. Protter
Exalted Contributor

Re: Simple DNS server (using Native HP-UX BIND)

Shalom,

DNS does not use /etc/hosts It uses zone records in /var/named or /var/named/chroot/var/named

HP has in the past provided a utility called hosts_to_named or similar name that converts an /etc/hosts file to DNS named zone records.

Here is a general how-to, aimed at Linux that I used to learn this years ago.

http://tldp.org/HOWTO/DNS-HOWTO.html

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Geoff Wild
Honored Contributor

Re: Simple DNS server (using Native HP-UX BIND)

Did you read this doc?

http://docs.hp.com/en/B2355-90775/index.html

Chapter 1 has a nice overview, and Chapter 2 tells you step by step how to configure Bind.

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
V.Manoharan
Valued Contributor

Re: Simple DNS server (using Native HP-UX BIND)

Hi
refer the link below.
http://docs.hp.com/en/B2355-90775/ch01s01.html
regards
Mano
Richard Briggs
Regular Advisor

Re: Simple DNS server (using Native HP-UX BIND)

Geoff...yes I did read that (both)...but the service doesn't work (nslookup -> server host.... lookup failed, server error)

I have 4 IP ranges... 10.1-255.*.* and 192.x.x.x and 172.2-25 and one other. So the hosts_to_named -d network -n number is confusing me and I don't know why the server won't serve addresses up using nslookup
#find / -name coffee | cup < cream
Geoff Wild
Honored Contributor

Re: Simple DNS server (using Native HP-UX BIND)

Okay - let us try some troubleshooting.

Is named running?

ps -ef |grep named

If no, then check:

/var/adm/named/named.log

Can you post your /etc/named.conf file?

Also, is NAMED=1 in /etc/rc.config.d/namesvrs ?

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Richard Briggs
Regular Advisor

Re: Simple DNS server (using Native HP-UX BIND)

Geoff, named is running. I don't have the /etc/rc.config.d/ switch input yet (read at boot time)

this is the error that I'm getting....

==================================
> server dnsserver
Specifying a server has overridden the switch policy order.
The reset command will reinstate the order specified by the switch policy.
Default Name Server: dnsserver.domain.com
Address: 10.11.11.11

> nslookup host1
*** Can't find address for server dnsserver: Server failed
> nslookup host1
Name Server: server.domain.com
Address: 10.11.11.11

*** dnsserver can't find nslookup: Server failed
==================================

this is the conf file:
-------------------------------------------

// generated by named-bootconf.pl

options {
check-names response fail; // do not change this
check-names slave warn;
directory "/etc/named.data"; // running directory for named
/*
* If there is a firewall between you and nameservers you want
* to talk to, you might need to uncomment the query-source
* directive below. Previous versions of BIND always asked
* questions using port 53, but BIND 8.1 uses an unprivileged
* port by default.
*/
// query-source address * port 53;
};

//
// type domain source file
//
zone "0.0.127.IN-ADDR.ARPA" {
type master;
file "db.127.0.0";
};

zone "dom.domain.com" {
type master;
file "db.dom";
};


zone "." {
type hint;
file "db.cache";
};

zone "10.IN-ADDR.ARPA" {
type master;
file "db.10";
};

zone "192.IN-ADDR.ARPA" {
type master;
file "db.192";
};

zone "172.IN-ADDR.ARPA" {
type master;
file "db.172";
};

--------------------------------------------
#find / -name coffee | cup < cream
Geoff Wild
Honored Contributor

Re: Simple DNS server (using Native HP-UX BIND)

> nslookup host1
*** Can't find address for server dnsserver: Server failed
> nslookup host1
Name Server: server.domain.com
Address: 10.11.11.11

*** dnsserver can't find nslookup: Server failed

Okay - that is kind of strange...


Are you running nslookup on the HPUX dnsserver or from another box?

If on the HPUX server (or any other for that matter) - what is in /etc/resolv.conf and what is the hosts line in /etc/nsswitch.conf?

Try uncommenting the // query-source address * port 53;

just remove the // and restart named.

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
KapilRaj
Honored Contributor

Re: Simple DNS server (using Native HP-UX BIND)

Do you really need a DNS ? Why not NIS with a hostname map ?

Regards,

Kaps
Nothing is impossible
Richard Briggs
Regular Advisor

Re: Simple DNS server (using Native HP-UX BIND)

Kaps, Yes. I have routers & switches as well as hpux servers. We normally use QIP (lucent's DNS), but that project is delayed, so I need a temporary DNS server with no bells, no whistles, just heart pumping DNS at cardio pace. ;-)
#find / -name coffee | cup < cream
Richard Briggs
Regular Advisor

Re: Simple DNS server (using Native HP-UX BIND)

Geoff... no dice. Did all that and same error. Thanks for trying though. I guess I'll open a ticket with HP and see what I'm doing wrong. I'll post a solution back here later
#find / -name coffee | cup < cream
Richard Briggs
Regular Advisor

Re: Simple DNS server (using Native HP-UX BIND)

Interesting caveat I just noticed:

Reverse look ups work... regular look ups fail:
++++++++++++++++++++++++++++++++++++++++++++
nslookup

> 10.11.12.14
Using /etc/hosts on: dns01

looking up FILES (not found)
Trying DNS
Name: host01.domain.com
Address: 10.11.12.14

> host01
Using /etc/hosts on: dns01

looking up FILES (not found)
Trying DNS
*** localhost can't find host01: Server failed
+++++++++++++++++++++++++++++++++++++++++++++
#find / -name coffee | cup < cream
Geoff Wild
Honored Contributor

Re: Simple DNS server (using Native HP-UX BIND)

try dig instead:

dig @hpuxserver host1.yourdomain.com


Check the zone file - is there an A record for host1?

Check the /var/adm/named/named.log file for errors related to that zone - maybe it didn't get loaded...

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Richard Briggs
Regular Advisor

Re: Simple DNS server (using Native HP-UX BIND)

Geoff:

1.) I don't have "dig", I guess it's not native to HP-UX 11.11?

2.) there is a record in the db.10 file:
11.12.14 IN PTR host01.domain.com.

3.) I don't have a dir /var/adm/named or a named.log file? How do I enable logging?

thanks!
#find / -name coffee | cup < cream
Richard Briggs
Regular Advisor

Re: Simple DNS server (using Native HP-UX BIND)

looks like logs go to syslog.log:

This is what I see when I start named:
Sep 27 09:50:28 dns01 named[15228]: master zone "10.IN-ADDR.ARPA" (IN) rejecte
d due to errors (serial 1)
Sep 27 09:50:28 dns01 named[15228]: master zone "192.IN-ADDR.ARPA" (IN) reject
ed due to errors (serial 1)
Sep 27 09:50:28 dns01 named[15228]: master zone "172.IN-ADDR.ARPA" (IN) reject
ed due to errors (serial 1)
Sep 27 09:50:28 dns01 named[15228]: listening on [10.11.12.14].53 (lan2)
Sep 27 09:50:28 dns01 named[15228]: listening on [127.0.0.1].53 (lo0)
Sep 27 09:50:28 dns01 named[15228]: Forwarding source address is [0.0.0.0].600
00
Sep 27 09:50:28 dns01 named[15229]: Ready to answer queries.


somebody put some underscores in some hostnames in /etc/hosts.
#find / -name coffee | cup < cream
Steven E. Protter
Exalted Contributor

Re: Simple DNS server (using Native HP-UX BIND)

Shalom,

Looks like the format of your zone records does not work. It also appears your system may need another zone record or two, the standards taht come with named.conf

named-checkzone is a linux utility used to check zone records.

If BIND for HP-UX does not provide this utility transfer your zone record to a linux machine with bind-utils installed and check them there.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Richard Briggs
Regular Advisor

Re: Simple DNS server (using Native HP-UX BIND)

OK.. I fixed all the errors in /etc/hosts and all the master zones loaded

what does this error mean?
=============================================
Sep 27 10:29:28 dns01 named[16364]: sysquery: findns error (NXDOMAIN) on dns01.domain.com?
=============================================
#find / -name coffee | cup < cream
Geoff Wild
Honored Contributor
Solution

Re: Simple DNS server (using Native HP-UX BIND)

Is there a record for host1 in db.dom file?

If not, then that's your answer.

No dig?

Ah - you have an older version of bind...

Could always upgrade:

http://h20293.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=BIND9.2


what does this error mean?
=============================================
Sep 27 10:29:28 dns01 named[16364]: sysquery: findns error (NXDOMAIN) on dns01.domain.com?

It means that dns01.domain.com is the target of an NS record, but there's no A record for that name.

Check the db.dom file!

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Richard Briggs
Regular Advisor

Re: Simple DNS server (using Native HP-UX BIND)

Thanks Geoff, I was able to pinpoint the flaw - (hosts_to_named must be run only once for all the networks... not sequentially {i.e. hosts_to_named -d domain.com -n 10
hosts_to_named -d domain.com -n 192
hosts_to_named -d domain.com -n 172} which is what I was doing... meaning only the 172 data was being loaded. The fix was to run it one time like so:
hosts_to_named -d domain.com -n 10 -n 192 -n 172 -r

couldn't have got there without your help... points for you! Thanks!

#find / -name coffee | cup < cream
Richard Briggs
Regular Advisor

Re: Simple DNS server (using Native HP-UX BIND)

answered
#find / -name coffee | cup < cream