# order for name resolution?

**URL:** https://forums.suse.com/t/order-for-name-resolution/28073
**Category:** SLES Configure-Administer
**Created:** [April 13, 2016, 9:50am UTC](https://forums.suse.com/t/order-for-name-resolution/28073 "2016-04-13T09:50:06Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![System1](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@System1](https://forums.suse.com/u/System1)
#### Post date: [April 13, 2016, 9:50am UTC](https://forums.suse.com/t/order-for-name-resolution/28073/1 "2016-04-13T09:50:06Z")

</div>

Hi,

here are a few SLES11SP4 systems. They run as a semi closed test structure.  
Semi closed as far as they has no records in the DNS. The systems use the  
/etc/hosts to resolve hostnames / FQDN in IP-Addresses.

It is possible to ping from one of theses test systems to another host of  
these structure, even I can use telnet to connect a service (e.g.  
postgresql) at another of these hosts.

But nslookup and dig asks only the DNS-Server and do not read the  
/etc/hosts. As far as I remember in the early years there was a possibility  
to overwrite the DNS with local entries in the /etc/hosts?!

How I can archieve this on SLES11SP4?

Bernd

---

<div class="post-metadata">

### Author: ![malcolmlewis](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/malcolmlewis/32/11375_2.png) [@malcolmlewis](https://forums.suse.com/u/malcolmlewis)
#### Post date: [April 13, 2016, 2:31pm UTC](https://forums.suse.com/t/order-for-name-resolution/28073/2 "2016-04-13T14:31:36Z")

</div>

> [@](#):
>
> On Wed 13 Apr 2016 06:50:06 AM CDT, Bernd wrote:
> 
> Hi,
> 
> here are a few SLES11SP4 systems. They run as a semi closed test  
> structure. Semi closed as far as they has no records in the DNS. The  
> systems use the /etc/hosts to resolve hostnames / FQDN in IP-Addresses.
> 
> It is possible to ping from one of theses test systems to another host  
> of these structure, even I can use telnet to connect a service (e.g.  
> postgresql) at another of these hosts.
> 
> But nslookup and dig asks only the DNS-Server and do not read the  
> /etc/hosts. As far as I remember in the early years there was a  
> possibility to overwrite the DNS with local entries in the /etc/hosts?!
> 
> How I can archieve this on SLES11SP4?
> 
> Bernd

Hi  
Via /etc/nsswitch.conf file via hosts and networks lines should sort it  
out.

–  
Cheers Malcolm Â°Â¿Â° LFCS, SUSE Knowledge Partner (Linux Counter #276890)  
SUSE Linux Enterprise Desktop 12 SP1|GNOME 3.10.4|3.12.53-60.30-default  
If you find this post helpful and are logged into the web interface,  
please show your appreciation and click on the star below… Thanks!

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)
#### Post date: [April 13, 2016, 4:45pm UTC](https://forums.suse.com/t/order-for-name-resolution/28073/3 "2016-04-13T16:45:43Z")

</div>

malcolmlewis wrote on Mittwoch, 13. April 2016 13:31 in  
suse.support.server.configure-administer :  
[color=blue]

> > [@](#):
> >
> > On Wed 13 Apr 2016 06:50:06 AM CDT, Bernd wrote:
> > 
> > Hi,
> > 
> > here are a few SLES11SP4 systems. They run as a semi closed test  
> > structure. Semi closed as far as they has no records in the DNS. The  
> > systems use the /etc/hosts to resolve hostnames / FQDN in IP-Addresses.
> > 
> > It is possible to ping from one of theses test systems to another host  
> > of these structure, even I can use telnet to connect a service (e.g.  
> > postgresql) at another of these hosts.
> > 
> > But nslookup and dig asks only the DNS-Server and do not read the  
> > /etc/hosts. As far as I remember in the early years there was a  
> > possibility to overwrite the DNS with local entries in the /etc/hosts?!
> > 
> > How I can archieve this on SLES11SP4?
> > 
> > Bernd
> 
> Hi  
> Via /etc/nsswitch.conf file via hosts and networks lines should sort it  
> out.  
> [/color]

Hi Malcom,  
thx. The nsswitch.conf shows ‘hosts: files dns’ and ping, etc. used it. But  
nslookup and dig seems not to use the libc to resolve hostnamens so they can  
not anwer with the IP-Address. … modern times 😉

Bernd

---

<div class="post-metadata">

### Author: ![Jens-U](https://avatars.discourse-cdn.com/v4/letter/j/d78d45/32.png) [@Jens-U](https://forums.suse.com/u/Jens-U)
#### Post date: [April 15, 2016, 3:49pm UTC](https://forums.suse.com/t/order-for-name-resolution/28073/4 "2016-04-15T15:49:55Z")

</div>

Hi Bernd,

> But  
> nslookup and dig seems not to use the libc to resolve hostnamens so they can  
> not anwer with the IP-Address. … modern times 😉

well, those two tools are designed to be DNS clients, so they’ll always go the DNS route.

Regards,  
Jens

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)
#### Post date: [April 19, 2016, 7:13pm UTC](https://forums.suse.com/t/order-for-name-resolution/28073/5 "2016-04-19T19:13:07Z")

</div>

jmozdzen wrote on Freitag, 15. April 2016 14:54 in  
suse.support.server.configure-administer :  
[color=blue]

> Hi Bernd,  
> [color=green]
> 
> > But  
> > nslookup and dig seems not to use the libc to resolve hostnamens so[/color]  
> > they can[color=green]  
> > not anwer with the IP-Address. … modern times ;-)[/color]
> 
> well, those two tools are designed to be DNS clients, so they’ll always  
> go the DNS route.[/color]

So it ended up, with an new bind for this zone on one of the servers in the  
test environment and comment out the entrys in the hosts file.

Thx, for your infos!

Bernd
