System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Help with hosts_to_named and DNS config

SOLVED
Go to solution
Ronny Horgen
Frequent Advisor

Help with hosts_to_named and DNS config

Hi, I tried to post this in networking, but with no response.

We are using HP-UX and hosts_to_named to run our DNS. Everything is working fine, but now we wanna have domain to resolve without using www prefix.

Now we get to our web-server with entering: www.aaa.com, but we also wanna have the folloing to work: aaa.com

Our web-server is hosted outside our own domain, and this is reflected in the hosts_to_named command as you will see.

In our /etc/hosts we have the following entry:
# External web-server-address
xyx.xyx.xyx.xyx www.aaa.com www

We have a spcl that looks like this:
cat spcl.aaa.com
$@ IN MX 5 post.aaa.com.

And the command line to hosts_to_named looks like this:
/var/named;hosts_to_named -F -d aaa.com -a xyx.xyx.xyx -a a.a.a
-n d.a.b -n d.b.b -n d.c.b -n d.d.b -n d.e.b -n d.f.b -n d.g.b
-M -u postmaster@aaa.com -o 10800:3600:604800:86400 -s here -s ns22 -s ns33 -s ns.there.com -b /etc/named.boot

Can I put something in spcl to get it right, or must I modify the commandline to get our domain to resolve to www.aaa.com without the www-prefix? Please advice on how to do this.
8 REPLIES
Rita C Workman
Honored Contributor
Solution

Re: Help with hosts_to_named and DNS config

I really am DNS challenged...but for a first thing why not change your hostfile.

You show above:
xyx.xyx.xyx.xyx www.aaa.com www

Why not make it:
xxx.xxx.xxx.xxx www.aaa.com aaa.com

..I thought if you use the hostfile to build your DNS, maybe this would help.

Just a thought,hopefully those DNS guru's will jump in quickly and give you the right way.

Rgrds,
Rita
Ronny Horgen
Frequent Advisor

Re: Help with hosts_to_named and DNS config

Rita, thanks for pointing that out. I just tried it, and it looks good.

I was confused by some other notes on the subject I found searching with google, and didn't try this before now.
Ronny Horgen
Frequent Advisor

Re: Help with hosts_to_named and DNS config

Hi again, I was a little bit to fast. Making an alias entry in /etc/hosts did not solve the problem. If there is any DNS guru's with a solution I would be very happy.
Tim Nelson
Honored Contributor

Re: Help with hosts_to_named and DNS config

I could be way off here but..

the host_to_named is for initial creation of your DNS configuration using the host file to generate the dns config files.

once you have dns configured why dont you just edit the appropriate files, changing what you need, recycle named and be done with it ?

Ronny Horgen
Frequent Advisor

Re: Help with hosts_to_named and DNS config

Hi Tim, we run hosts_to_named from a script every time we add or remove a hosts, and have done so a long time. It's easy and it have been working fine.
Horia Chirculescu
Honored Contributor

Re: Help with hosts_to_named and DNS config

Hello,

hosts_to_named created the zone files in /var/named (assuming you have first cd into that dir)

On db.aaa file modify the aaa zone to add the line:

aaa.com CNAME www.aaa.com.

You should use TABs to separate the entries!.

Then in the same file, increment the Serial no of the zone (usually this is 1 afther running hosts_to_named script). It is a common practice to set this serial no. like this:

YYYYMMDDvv

(
where of course:
YYYY - Year like 2010
MM - month 01
DD - day 28
vv - release 00

so will be 2010012800.
)

To force the named server to re-read its database, you should send a SIGHUP signal. (kill -1 named's pid). Or stop/start the named process (not an elegant solution).

Best regards,
Horia.
Best regards from Romania,
Horia.
Ronny Horgen
Frequent Advisor

Re: Help with hosts_to_named and DNS config

Hi Horia, yes we did as you say and wrote a small script to do this.

On db.aaa file modify the aaa zone to add the line:

aaa.com CNAME www.aaa.com.

This worked fine for å few days, but now suddenly something is broken.
Instead for resolving like this:
www.aaa.com -> aaa.com
This has become:
www.aaa.com -> aaa.com.aaa.com

Can anybody tell med what is wrong, and why this changed after some days?
Horia Chirculescu
Honored Contributor

Re: Help with hosts_to_named and DNS config

Hello Ronny,

Can you post here aaa.com zone?

Best regards,
Horia.
Best regards from Romania,
Horia.