1832310 Members
2687 Online
110041 Solutions
New Discussion

hosts_to_named

 
Fred Martin_1
Valued Contributor

hosts_to_named

There are several threads here about setting up DNS and running hosts_to_named, and I've reviewed them.

I do have one thing to throw out here though.

If hosts_to_named uses my existing /etc/hosts file as the basis for building a DNS database, I should think that it would want to be correct as possible before I start.

Given that, I know that my HP-UX hosts file was used back when we were a stand-alone network, then tweaked when we got internet access, etc. so I'm not certain it's properly set up.

Here's a fragment:

127.0.0.1 localhost loopback
209.90.236.66 corp applicatorssales.com
mail mail.applicatorssales.com
209.90.236.81 host1
...etc...

Some more info:
# domainname

# hostname
corp

It seems that, if this were properly set up, the domainname command would not return a blank line, and hostname should return the canonical name "corp.applicatorssales.com" isn't that right?

Any info about this would be appreciated.
Fred
fmartin@applicatorssales.com
8 REPLIES 8
Anthony deRito
Respected Contributor

Re: hosts_to_named

Fred, the name returned by domainname is actually used by NIS not DNS. It has nothing to do with DNS. The hostname returned by hostname is actually the name that was assigned when the operating system was installed.

Tony
Kofi ARTHIABAH
Honored Contributor

Re: hosts_to_named

Fred:

domainname command is only useful when you are using NIS (Network Information Service) and as you obviously are not, there is nothing to worry about - it should return blank.

do a man on domainname for more info.
nothing wrong with me that a few lines of code cannot fix!
Rhonda Thorne
Frequent Advisor

Re: hosts_to_named

domainname is a NIS command not a DNS command. to look to see if DNS is setup, nslookup or review the /etc/named.boot file to see your domain.

If you are not sure about your /etc/hosts validation, contact your network guys for a complete IP list and compare the assigned IP's to you /etc/hosts.

Sharing the knowledge
Sharing my knowledge of UNIX flavors
Fred Martin_1
Valued Contributor

Re: hosts_to_named

Well I am the network guy :)

Let's look at the hosts information then - is the entry for the unix box (corp - soon to be the DNS server) correct in that example?

I'm thinking it should be:

209.90.236.66 corp.applicatorssales.com corp etc etc

Fred
fmartin@applicatorssales.com
Madhu Sudhan_1
Respected Contributor

Re: hosts_to_named

Fred !

1) domainname doesn't return FQDN. It always returns NIS domainname (LAN).
2) hostname returns what is configured in the /etc/hosts as the hostname. It doesn't care for the alias.

I think as of your domain configuration is taken care by your web server.

...Madhu
Think Positive
Anthony deRito
Respected Contributor

Re: hosts_to_named

Fred, just an FYI... your profile states that you have only given points to 23 of 93 respondents to your questions.... not a very good track record. Dish out the points and show your appreciation and you may get more help.

Tony
Rhonda Thorne
Frequent Advisor

Re: hosts_to_named

yes. your entry for corp is correct. However, the /etc/hosts file will need all IP's assigned that you want DNS to respond to. So if you have other servers....etc...then you need to added them as well.

The /etc/named.boot will need to be updated that this box is the server and all clients (including the DNS server) will need the entries in /etc/resolv.conf to reflect the IP of the new DNS server that each client is to look to for answers. The /ets/hosts needs to have more info than just itself to create the DNS servers serach list to use with the hosts_to_named.

regards
Sharing my knowledge of UNIX flavors
Rhonda Thorne
Frequent Advisor

Re: hosts_to_named

Also, the you will need a named.conf file in the named.data area to tell host_to_named what nets and sub nets to look for in the /etc/hosts file. Man hosts_to_named for more infor on it's requirements

Sharing the knowledge
Sharing my knowledge of UNIX flavors