Lookup up host from /etc/hosts instead of DNS

Lookup up host from /etc/hosts instead of DNS

Post by Rudi » Wed, 18 Jun 2003 20:35:47



Hi,

If  I dont have a DNS server and I just want sendmail to lookup the host in
the local hostfile(/etc/hosts) , how would I go about this ?

I am running Redhat 7.0

the /etc/nsswitch.conf file has the following entry at the hosts section:

hosts:      files nisplus nis dns

Can anyone help on this simple, but frustrating matter.

Thanks
Rudi

 
 
 

Lookup up host from /etc/hosts instead of DNS

Post by p.. » Thu, 19 Jun 2003 04:16:48



> Hi,
> If  I dont have a DNS server and I just want sendmail to lookup the host in
> the local hostfile(/etc/hosts) , how would I go about this ?
> I am running Redhat 7.0
> the /etc/nsswitch.conf file has the following entry at the hosts section:
> hosts:      files nisplus nis dns
> Can anyone help on this simple, but frustrating matter.

I don't think you really want sendmail to use hostfiles. Have you
really given your full attention understanding exactly what you want
to do ?   Have you discussed the solution space with someone else ?

Quote:> Thanks
> Rudi

--
Peter H?kanson        
        IPSec  Sverige      ( At Gothenburg Riverside )
           Sorry about my e-mail address, but i'm trying to keep spam out,
           remove "icke-reklam" if you feel for mailing me. Thanx.

 
 
 

Lookup up host from /etc/hosts instead of DNS

Post by Barry Margoli » Thu, 19 Jun 2003 04:32:20




>Hi,

>If  I dont have a DNS server and I just want sendmail to lookup the host in
>the local hostfile(/etc/hosts) , how would I go about this ?

>I am running Redhat 7.0

>the /etc/nsswitch.conf file has the following entry at the hosts section:

>hosts:      files nisplus nis dns

>Can anyone help on this simple, but frustrating matter.

sendmail needs to look up MX records, which don't exist.  So it always uses
DNS, rather than going through the name service switch.

--

Level(3), Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

 
 
 

Lookup up host from /etc/hosts instead of DNS

Post by Glen Herrmannsfeld » Thu, 19 Jun 2003 05:22:11





> >Hi,

> >If  I dont have a DNS server and I just want sendmail to lookup the host
in
> >the local hostfile(/etc/hosts) , how would I go about this ?

> >I am running Redhat 7.0

> >the /etc/nsswitch.conf file has the following entry at the hosts section:

> >hosts:      files nisplus nis dns

> >Can anyone help on this simple, but frustrating matter.

> sendmail needs to look up MX records, which don't exist.  So it always
uses
> DNS, rather than going through the name service switch.

Well, in the olden days sendmail could be configured to send all outside
mail to a server that did know how to reach other hosts.   In that case,
only that host would be needed in the hosts file.

But it would be usual for modern hosts to send directly to the destination.

-- glen

 
 
 

Lookup up host from /etc/hosts instead of DNS

Post by Barry Margoli » Thu, 19 Jun 2003 05:32:12






>> sendmail needs to look up MX records, which don't exist.  So it always
>uses
>> DNS, rather than going through the name service switch.

>Well, in the olden days sendmail could be configured to send all outside

It still can -- this is often needed to deal with firewalls.

Quote:>mail to a server that did know how to reach other hosts.   In that case,
>only that host would be needed in the hosts file.

Actually, in my experience sendmail performed an MX lookup for the relay
host, too.  I never thought that was right, but it's the way it worked.

In SunOS 4.x, Sun had a modified sendmail that used /etc/hosts and NIS
rather than DNS; a more "normal" sendmail was distributed as sendmail.mx.

--

Level(3), Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

 
 
 

Lookup up host from /etc/hosts instead of DNS

Post by Glen Herrmannsfeld » Thu, 19 Jun 2003 14:37:05







> >> sendmail needs to look up MX records, which don't exist.
> >>  So it always uses DNS, rather than going through the
> >> name service switch.

> >Well, in the olden days sendmail could be configured to send all outside

> It still can -- this is often needed to deal with firewalls.

Or with spam protection.  My home network is on a dynamic IP address (it
changes about once a year so dynamic isn't quite the right word).  aol.com
refuses mail from me because I don't forward it through the ISP.
Fortunately I don't send to aol very much.

Quote:> >mail to a server that did know how to reach other hosts.   In that case,
> >only that host would be needed in the hosts file.

> Actually, in my experience sendmail performed an MX lookup for the relay
> host, too.  I never thought that was right, but it's the way it worked.

> In SunOS 4.x, Sun had a modified sendmail that used /etc/hosts and NIS
> rather than DNS; a more "normal" sendmail was distributed as sendmail.mx.

I remember those days.   Though I usually got the version of libc.so that
included the resolver library routines instead of the NIS routines.  I don't
remember if I still needed sendmail.mx after doing that or not.

At about that time we ran a version of HP-UX that didn't know about DNS.

-- glen

 
 
 

Lookup up host from /etc/hosts instead of DNS

Post by Villy Kru » Thu, 19 Jun 2003 16:58:42


On Tue, 17 Jun 2003 13:35:47 +0200,

Quote:>Hi,

>If  I dont have a DNS server and I just want sendmail to lookup the host in
>the local hostfile(/etc/hosts) , how would I go about this ?

>I am running Redhat 7.0

>the /etc/nsswitch.conf file has the following entry at the hosts section:

>hosts:      files nisplus nis dns

>Can anyone help on this simple, but frustrating matter.

How to do that is described in the file op.me or op.ps.  You can use
ghostview to display the latter.  The keyword is: "ServiceSwitchFile"

Villy

 
 
 

Lookup up host from /etc/hosts instead of DNS

Post by Barry Margoli » Thu, 19 Jun 2003 23:30:26






>> In SunOS 4.x, Sun had a modified sendmail that used /etc/hosts and NIS
>> rather than DNS; a more "normal" sendmail was distributed as sendmail.mx.

>I remember those days.   Though I usually got the version of libc.so that
>included the resolver library routines instead of the NIS routines.  I don't
>remember if I still needed sendmail.mx after doing that or not.

Yes you did.  The modified libc.so would look up A records, but how could
gethostbyname() possibly return MX records?

--

Level(3), Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

 
 
 

Lookup up host from /etc/hosts instead of DNS

Post by Glen Herrmannsfeld » Fri, 20 Jun 2003 15:02:44







> >> In SunOS 4.x, Sun had a modified sendmail that used /etc/hosts and NIS
> >> rather than DNS; a more "normal" sendmail was distributed as
sendmail.mx.

> >I remember those days.   Though I usually got the version of libc.so that
> >included the resolver library routines instead of the NIS routines.  I
don't
> >remember if I still needed sendmail.mx after doing that or not.

> Yes you did.  The modified libc.so would look up A records, but how could
> gethostbyname() possibly return MX records?

That makes sense.  What I was trying to remember was if sendmail.mx went
directly to DNS, instead of indirectly.  We always ran the modified libc.so,
but the Sun standard way was to run NIS, and then have an NIS server that
did DNS, even on the same machine.  I never did that.

Though at the time I don't remember MX being so popular.  The one use I do
remember for it is for UUCP, so mail would be sent to the server that could
UUCP it to the destination.  I did once run UUCP between an OS/2 1.0 machine
and a unix machine.

-- glen

 
 
 

Lookup up host from /etc/hosts instead of DNS

Post by Mark Damros » Sat, 21 Jun 2003 03:31:31



Quote:

> Actually, in my experience sendmail performed an MX lookup for the relay
> host, too.

It will do an MX lookup anywhere a name or IP is used.  Enclose in square
brackets to disable.

Quote:> I never thought that was right, but it's the way it worked.

Agreed.
 
 
 

Lookup up host from /etc/hosts instead of DNS

Post by Fernando Go » Mon, 23 Jun 2003 17:37:08


On Wed, 18 Jun 2003 05:37:05 GMT, "Glen Herrmannsfeldt"


>Or with spam protection.  My home network is on a dynamic IP address (it
>changes about once a year so dynamic isn't quite the right word).  aol.com
>refuses mail from me because I don't forward it through the ISP.

Sorry?

--
Fernando Gont

[To send a personal reply, please remove the ANTISPAM tag]

 
 
 

Lookup up host from /etc/hosts instead of DNS

Post by Glen Herrmannsfeld » Wed, 25 Jun 2003 11:53:32



> On Wed, 18 Jun 2003 05:37:05 GMT, "Glen Herrmannsfeldt"

> >Or with spam protection.  My home network is on a dynamic IP address (it
> >changes about once a year so dynamic isn't quite the right word).
aol.com
> >refuses mail from me because I don't forward it through the ISP.

> Sorry?

AOL refuses mail from me, just because I have a dynamic address.  They don't
check at all that I have never sent spam.

I am not sure why, as the source address will be the same, forwarded through
my ISP or sent directly.

-- glen

 
 
 

Lookup up host from /etc/hosts instead of DNS

Post by Barry Margoli » Sat, 28 Jun 2003 23:37:01






>> On Wed, 18 Jun 2003 05:37:05 GMT, "Glen Herrmannsfeldt"

>> >Or with spam protection.  My home network is on a dynamic IP address (it
>> >changes about once a year so dynamic isn't quite the right word).
>aol.com
>> >refuses mail from me because I don't forward it through the ISP.

>> Sorry?

>AOL refuses mail from me, just because I have a dynamic address.  They don't
>check at all that I have never sent spam.

How can they know if you have or haven't ever sent spam?  It's a dynamic
address, so there's no point in trying to track address-specific history.
They simply assume that mail sent directly from dynamic addresses is vastly
more likely to be spam than legit, since it's so rare for people to run
real mail servers through such services.

Quote:>I am not sure why, as the source address will be the same, forwarded through
>my ISP or sent directly.

No it won't.  If you relay through your ISP, the source address of the TCP
connection will be the ISP's mail server.

Many ISPs implement rate limits on their mail servers, so spammers will not
find it effective to send out through them.  This is one reason why they
either try to send directly from their own machines (which the anti-dynamic
filter blocks) or look for open relays (but these are soon blacklisted).

--

Level(3), Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

 
 
 

Lookup up host from /etc/hosts instead of DNS

Post by Glen Herrmannsfeld » Fri, 04 Jul 2003 10:45:46



Quote:> >AOL refuses mail from me, just because I have a dynamic address.  They
don't
> >check at all that I have never sent spam.

> How can they know if you have or haven't ever sent spam?  It's a dynamic
> address, so there's no point in trying to track address-specific history.
> They simply assume that mail sent directly from dynamic addresses is
vastly
> more likely to be spam than legit, since it's so rare for people to run
> real mail servers through such services.

It may be dynamic, but its rate of change less than 1/year.  That is
probably about the same as many static addresses.

Quote:> >I am not sure why, as the source address will be the same, forwarded
through
> >my ISP or sent directly.
> No it won't.  If you relay through your ISP, the source address of the TCP
> connection will be the ISP's mail server.

The source mail address is what I meant, not the IP address.

Quote:> Many ISPs implement rate limits on their mail servers, so spammers will
not
> find it effective to send out through them.  This is one reason why they
> either try to send directly from their own machines (which the
anti-dynamic
> filter blocks) or look for open relays (but these are soon blacklisted).

Like many other things these days, it seems to be guilty until proved
innocent, and even then I don't get a chance to prove I'm innocent.

There is also the one pound limit on mailboxes that assumes I will be
mailing a bomb unless I take it to a post office, as another example.

-- glen

 
 
 

1. HELP: sys:\etc\hosts ... sys:\etc\hosts.deny?

Hi all,

We are using Netware 4.11.

Is it possible to use sys:\etc\hosts to deny access from specific hosts or
IP-ranges? Or limit TCP/IP access to adresses from a certain range? Like:
137.120.*.* or something like that? If we can not use the hosts file for this,
is there another way to limit TCP/IP-access to specific addresses?

I'd appriciate it if you would email me your answer.

Thank you in advance,

Robert Peperkamp
Comp. Sci. Engineer
University Maastricht
Medical Faculty

2. Automatic Login on W98

3. Reverse lookup from /etc/hosts?

4. Setup says no HD controller driver

5. How can i host virtual hosts via DNS?

6. product evolution complications

7. DNS Host File Vs Hosts File

8. DNS must be hosed: sendmail gives "host name lookup failure"

9. DXTERM fails to use DNS/Bind for Host lookups

10. [Fwd: DNS Import of /etc/hosts file]

11. DNS Import of /etc/hosts file

12. /etc/hosts to dns records