Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
dnslookup order hosts,bind - hosts file is not read
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
pointers
Tux's lil' helper
Tux's lil' helper


Joined: 18 Apr 2004
Posts: 123

PostPosted: Wed Jan 04, 2006 8:57 am    Post subject: dnslookup order hosts,bind - hosts file is not read Reply with quote

Hi,
My entries in /etc/hosts file are not used by my resolver. Here is my /etc/host.conf and nsswitch.conf files

host.conf
Quote:
order hosts, bind


nsswitch.conf
Quote:
hosts: files dns
networks: files dns


#strace host domain.com

doesnt show any evidence such that resolver looks at /etc/hosts file. Permissions are ok.

What can be the problem ?

Thanks a lot.[/quote]
Back to top
View user's profile Send private message
fvant
Guru
Guru


Joined: 08 Jun 2003
Posts: 328
Location: Leiden, The Netherlands

PostPosted: Wed Jan 04, 2006 9:06 am    Post subject: Reply with quote

Is an nss cache running, such as nscd?
Back to top
View user's profile Send private message
pointers
Tux's lil' helper
Tux's lil' helper


Joined: 18 Apr 2004
Posts: 123

PostPosted: Wed Jan 04, 2006 9:09 am    Post subject: no nss Reply with quote

Hi it is not running,
here is the rc-status

Quote:

Runlevel: default
local [ started ]
netmount [ started ]
syslog-ng [ started ]
vixie-cron [ started ]
domainname [ started ]
net.eth0 [ started ]
sshd [ started ]
postfix [ started ]
apache2_chroot [ started ]
mysql [ started ]
snmpd [ started ]
ntp-client
Back to top
View user's profile Send private message
Katphish
Apprentice
Apprentice


Joined: 05 Dec 2005
Posts: 155

PostPosted: Wed Jan 04, 2006 9:14 am    Post subject: Reply with quote

Hi,

It is working. Try to ping a name that is in your host file.

The `host` command is a DNS tool according to the man page.
Back to top
View user's profile Send private message
pointers
Tux's lil' helper
Tux's lil' helper


Joined: 18 Apr 2004
Posts: 123

PostPosted: Wed Jan 04, 2006 9:19 am    Post subject: ping Reply with quote

ping looks at /etc/hosts file ok. But Before host command was using /etc/hosts file too, my aim is to
to tell some of the entries in /etc/hosts into the postfix but postfix does not look at this file and directly use resolv.conf
According to postfix documents if order in host.conf or nsswitch.conf files are like mine,
then postfix should look at hosts file. Before postfix was using this file now it isnt.

I dont know what the problem is:(
Back to top
View user's profile Send private message
Katphish
Apprentice
Apprentice


Joined: 05 Dec 2005
Posts: 155

PostPosted: Wed Jan 04, 2006 9:47 am    Post subject: Reply with quote

What are you trying to do with postfix? Route mail locally?

It might be worth setting up a DNS server if you have a few machines.
Back to top
View user's profile Send private message
pointers
Tux's lil' helper
Tux's lil' helper


Joined: 18 Apr 2004
Posts: 123

PostPosted: Wed Jan 04, 2006 9:51 am    Post subject: local mail Reply with quote

Hi,
It is just a simple entry and I dont want to use dns for this purpose. I just would like to fix this problem on the postfix side.
Now I am using a simple routing solution.

Thanks for your helps friend I will try to find it.
Back to top
View user's profile Send private message
xglad
n00b
n00b


Joined: 13 Aug 2002
Posts: 53
Location: Ft. Lauderdale, FL, USA.

PostPosted: Tue Feb 07, 2006 8:31 pm    Post subject: Reply with quote

I've got this same problem. Same circumstances as the OP. No nscd, same stuff in host.conf and nsswitch.conf.

<edit>
See the smtp_host_lookup in $ man 5 postconf. The possible values seem a little half-baked (there is no native,dns order apparently), but for pure /etc/hosts usage, this fixes my problem.
</edit>
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum