Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Dec 2003 23:13:31 +0000
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        Gary Kline <kline@thought.org>
Cc:        FreeBSD Mailing List <freebsd-questions@freebsd.org>
Subject:   Re: DNS || sendmail? (or both?)
Message-ID:  <20031221231331.GA60772@happy-idiot-talk.infracaninophile.co.uk>
In-Reply-To: <20031221204900.GA78888@tao.thought.org>
References:  <20031221204900.GA78888@tao.thought.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--M9NhX3UHpAaciwkO
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sun, Dec 21, 2003 at 12:49:00PM -0800, Gary Kline wrote:

> 	I've been wondring if there is a way of tweaking sendmail
> 	to send mail from the outside to my internal//private hosts--
> 	with the same username and the FQDN.
>=20
> 	E.g.:  Outside thought.org, "root@tao.thought.org" bounces
> 	while "root@ns1.thought.org" is recognized because=20
> 	ns1.thought.org is 216.231.43.140.   Likewise with mail
> 	to "root@ethic.thought.org" or "root@plato.thought.org".
>=20
> 	Anybody know what magic incantations are necessary to make
> 	my mail server aware of my internal hosts??  If this is a
> 	DNS matter, I didn't catch it in DNS AND BIND (4th ed).

It's do-able.  First step is that you will need DNS records for all of
the addresses you want visible in the Internet.  You can just setup MX
records pointing at your gateway machine: eg.

    $ORIGIN thought.org
    [...]

    tao    MX 10 ns1
    ethic  MX 10 ns1
    plato  MX 10 ns1

which tells the outside world that ns1.thought.org handles the e-mail
for {tao,ethic,plato}.thought.org[*] If ns1 will do final delivery of
this e-mail, then as another poster said, you just need to add those
hostnames to /etc/mail/local-host-names.  On the other hand, if you
want your the messages forwarded from ns1 to those internal machines,
leave local-host-names alone and put the following line in
/etc/mail/mailertable:

    .thought.org	relay:[%1.thought.org]

Then just run 'make' in /etc/mail (Nb. mailertable support is in the
default freebsd.mc config, so no config tweaking required.)  (Nb.2 the
[square brackets] suppress sendmail's looking up MX records when it
tries to relay the messages.  This stops ns1 trying to relay the
messages back to itself.)

	Cheers,

	Matthew

[*] It's possible, but nasty, to use a wildcard record, so that
username@{anything}.thought.org gets delivered to your mail server.
However, use of wildcards in the DNS is not recommended as that way
madness lies. =20

--=20
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK

--M9NhX3UHpAaciwkO
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQE/5ikbdtESqEQa7a0RAi6lAJsF5eWmyz9DU2NTuN5rOa7XIaVa2QCbBQgF
3j90i7/DKLa76SlG+87W6uM=
=nNil
-----END PGP SIGNATURE-----

--M9NhX3UHpAaciwkO--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031221231331.GA60772>