Those programs which only need to convert a hostname to an IP address call
gethostbyname(). Usually this will look in /etc/hosts, then try a DNS query.
Other programs make DNS queries directly through the resolver libraries
(res_query and friends), so they will ignore what is in /etc/hosts. "host"
is a DNS query tool and falls into this category.
For sendmail, you can force it to deliver <user>@<host> via a particular
host using the 'mailertable' facility.
/etc/mailertable:
kitty.n7vvl.ampr.org smtp:[192.168.13.13]
(In fact, I _think_ you can put a hostname inside the square brackets and
sendmail will call gethostbyname, and thus pick up the IP address from
/etc/hosts)
# makemap hash /etc/mailertable </etc/mailertable
Add FEATURE(mailertable) and FEATURE(nocanonify) to your .mc file and
rebuild sendmail.cf
You can do other cool stuff with this, e.g.
.ampr.org smtp:[44.1.2.3]
to smarthost all domains ending .ampr.org to your nearest packet radio mail
relay.
> resolv.conf:
> search n7vvl.ampr.org
> nameserver 204.146.247.41
OK, well the alternative approach is to:
(1) install and run bind
(2) set 'nameserver 127.0.0.1' in resolv.conf, so that you have a working
caching nameserver
(3) make yourself primary for n7vvl.ampr.org and 168.192.in-addr.arpa
[n7vvl.ampr.org zone file]
kitty A 192.168.13.13
[168.192.in-addr.arpa zone file]
13.13 PTR kitty.n7vvl.ampr.org.
You need SOA records in each of those too.
In that case mail will work internally for you, and it means many machines
can share the same host information (just point their resolvers at this
machine).
This DNS information is private to you, unless you get delegation from
outside. At the moment people see different information:
# nslookup -q=any n7vvl.ampr.org
n7vvl.ampr.org internet address = 44.40.1.30
# nslookup -q=any kitty.n7vvl.ampr.org
*** can't find kitty.n7vvl.ampr.org: Non-existent host/domain
Cheers,
Brian.
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.rutgers.edu