Operating System - HP-UX
1833178 Members
2693 Online
110051 Solutions
New Discussion

Why it prompt duplicated alias when ypcat?

 
SOLVED
Go to solution
leereg_6
Advisor

Why it prompt duplicated alias when ypcat?

Hi,
I have record

135.252.abc.def hostaa
in my NIS databas, but when I do a ypcat on one NIS client, it prompted:

hostser: ypcat hosts|grep hostaa
135.252.abc.def hostaa
135.252.abc.def hostaa

Why?


Thanks a lot!
9 REPLIES 9
Stefan Farrelly
Honored Contributor

Re: Why it prompt duplicated alias when ypcat?

check if hostaa is in the NIS hosts map AND your /etc/hosts file on your NIS client.
Im from Palmerston North, New Zealand, but somehow ended up in London...
leereg_6
Advisor

Re: Why it prompt duplicated alias when ypcat?

I have one single line in my hosts file and there was no record about hostaa in my NIS client.
Stefan Farrelly
Honored Contributor

Re: Why it prompt duplicated alias when ypcat?

maybe the cache file of the map on your NIS client is bad. On the NIS server do;

touch /etc/hosts
ypmake hosts

so it pushes the map out again then see if that fixes it.
Im from Palmerston North, New Zealand, but somehow ended up in London...
U.SivaKumar_2
Honored Contributor
Solution

Re: Why it prompt duplicated alias when ypcat?

Hi,

hostaa has some aliases defined in /etc/hosts.
eg:-
135.xxx.xxx.xxx hostaa myhost host1

you might have created the NIS database with the above hosts file. Remove the hosts aliases
of hostaa and rebuild hosts map.

regards,

U.SivaKumar
Innovations are made when conventions are broken
leereg_6
Advisor

Re: Why it prompt duplicated alias when ypcat?

Hi U.SivaKumar,
You are absolutely right. I gave a try and the result is:
For the hosts who have five aliase, the result is file duplicated lines like:
# ypcat hosts|grep hostcc
135.252.hde.wer hostcc loghost mailhost dns elsename
135.252.hde.wer hostcc loghost mailhost dns elsename
135.252.hde.wer hostcc loghost mailhost dns elsename
135.252.hde.wer hostcc loghost mailhost dns elsename
135.252.hde.wer hostcc loghost mailhost dns elsename
For the hosts who have two alias,the result contain two duplicated lines:
# ypcat hosts|grep hostaa
135.252.abc.def hostaa movei
135.252.abc.def hostaa movei

What the root cause?

U.SivaKumar_2
Honored Contributor

Re: Why it prompt duplicated alias when ypcat?

Hi,

This is the normal behaviour of NIS when hostname in /etc/hosts contains aliases.

If you don't want aliases remove it from /etc/hosts file and rebuild NIS hosts map.

regards,
U.SivaKumar
Innovations are made when conventions are broken
leereg_6
Advisor

Re: Why it prompt duplicated alias when ypcat?

I have a mixed NIS network composed of SUN and HP-UX, but on a nis client of HP, there is no such problem. And on Solaris, this always appear.



Regards!
U.SivaKumar_2
Honored Contributor

Re: Why it prompt duplicated alias when ypcat?

Hi,

I think this is a known issue with solaris

regards,

U.SivaKumar
Innovations are made when conventions are broken
leereg_6
Advisor

Re: Why it prompt duplicated alias when ypcat?

Hi,U.SivaKumar

How to resolve it?



Thanks a lot!