Discussion:
use the /etc/hosts file
Tor Pretorius
2010-10-14 08:35:22 UTC
Permalink
Hi

How can I set the NAV 3.6, to use /etc/hosts file instead of dns server names
in the column Name in the report.



Med vennlig hilsen / Best Regards

Tor Pretorius
Senior konsulent Data
Instrumenttjenesten AS
Frederik A. Dahlsvei 20
1432 Ås
91716759 / 64949840
www.it-as.no<http://www.it-as.no/>
Morten Brekkevold
2010-10-26 09:49:39 UTC
Permalink
Post by Tor Pretorius
How can I set the NAV 3.6, to use /etc/hosts file instead of dns server names
in the column Name in the report.
You can't. The report itself only lists the names stored in the database.
Those names are set by ipdevpoll, which uses DNS reverse-lookups to find
names.
--
Morten Brekkevold
UNINETT
Vidar Faltinsen
2010-10-26 16:09:10 UTC
Permalink
Post by Morten Brekkevold
Post by Tor Pretorius
How can I set the NAV 3.6, to use /etc/hosts file instead of dns server names
in the column Name in the report.
You can't. The report itself only lists the names stored in the database.
Those names are set by ipdevpoll, which uses DNS reverse-lookups to find
names.
But won't a DNS reverse lookup first look in /etc/hosts before querying
the dns server? I thought that was default behaviour.

- Vidar
Stokkenes Vidar
2010-10-27 07:09:43 UTC
Permalink
I don't know what changed from gDD to ipdevpoll regarding this, but in earlier versions, NAV would update the name of a switch if rDNS was broken the day you added the device in NAV - if you later fixed rDNS. And by adding the given host to /etc/hosts (give you have the right order in nsswitch.conf) shouldn't the same thing happen with ipdevpoll?

-Vidar

-----Original Message-----
From: Vidar Faltinsen [mailto:vidar.faltinsen-***@public.gmane.org]
Sent: 26. oktober 2010 18:09
To: Morten Brekkevold
Cc: Tor Pretorius; nav-users-***@public.gmane.org
Subject: Re: use the /etc/hosts file
Post by Morten Brekkevold
Post by Tor Pretorius
How can I set the NAV 3.6, to use /etc/hosts file instead of dns server names
in the column Name in the report.
You can't. The report itself only lists the names stored in the database.
Those names are set by ipdevpoll, which uses DNS reverse-lookups to find
names.
But won't a DNS reverse lookup first look in /etc/hosts before querying
the dns server? I thought that was default behaviour.

- Vidar
Morten Brekkevold
2010-10-27 08:47:46 UTC
Permalink
Post by Stokkenes Vidar
I don't know what changed from gDD to ipdevpoll regarding this, but in
earlier versions, NAV would update the name of a switch if rDNS was broken
the day you added the device in NAV - if you later fixed rDNS. And by
adding the given host to /etc/hosts (give you have the right order in
nsswitch.conf) shouldn't the same thing happen with ipdevpoll?
As I explained to the other Vidar, ipdevpoll doesn't use the socket library
mechanisms for DNS lookups, since it needs to work asynchronously.
/etc/nsswitch.conf is irrelevant in this case.
--
Morten Brekkevold
UNINETT
Morten Brekkevold
2010-10-27 08:45:39 UTC
Permalink
Post by Vidar Faltinsen
Post by Morten Brekkevold
You can't. The report itself only lists the names stored in the database.
Those names are set by ipdevpoll, which uses DNS reverse-lookups to find
names.
But won't a DNS reverse lookup first look in /etc/hosts before querying
the dns server? I thought that was default behaviour.
Not for a DNS protocol client. It doesn't know about /etc/hosts, it just
talks DNS over IP.

ipdevpoll uses Twisted's names framework, which has multiple resolvers. The
primary resolver is a DNS protocol client. The secondary is a '/etc/hosts'
resolver, but apparently, this doesn't support reverse lookups using
/etc/hosts, only forward lookups.

This will need further investigation before we can conclude.
--
Morten Brekkevold
UNINETT
Sigurd Mytting
2010-10-30 07:21:17 UTC
Permalink
Post by Tor Pretorius
Hi
How can I set the NAV 3.6, to use /etc/hosts file instead of dns server
names in the column Name in the report.
Hi,

I have a defective corporate DNS so I hacked toghether something who
dumps the netbox-info from NAV, asks each device it's SNMP-hostname and
builds a bind-configuration who overrides those records in the corporate
DNS.

Drop me an email if you'd like a copy of the script. It's about 130ish
lines of perl and you need to know a bit of bind configuration.

Cheers,

-Sigurd

Loading...