1833782 Members
2484 Online
110063 Solutions
New Discussion

2 Domains for 1 host?

 
Jon Sharp
Occasional Contributor

2 Domains for 1 host?

I have 2 interface cards with differnet IP addresses, connected to different
networks - and the IP addresses relate to differnet domains.
A lot of configuration code (eg sendmail) assumes a single domain on the
machine. Is it possible to differentiate the domain associated with an
interface card?
4 REPLIES 4
Berlene Herren_1
Super Advisor

Re: 2 Domains for 1 host?

Jon, what type of errors are you seeing?

Berlene
Jon Sharp
Occasional Contributor

Re: 2 Domains for 1 host?

What I want to do is to manage access to 2 domains - through 2 interface
cards. The resolver routines typically expect the machine to be under 1
domain.
I can setup sendmail to assume a particular domain, but I would like to be
able to point the resolver at the DNS for one domain, and also to check the
/etc/hosts file for the other. Is this best done by setting up a local DNS
(caching?) with the /etc/hosts values in it, and pointing to this in
/etc/resolv.conf?
Frank Timmers_1
New Member

Re: 2 Domains for 1 host?

Hi,

If I understood right, you want your system mainly be part of domain
first.domain, but let sendmail use second.domain. If this is the case, you'll
have to edit the sendmail.cf.

Search for the token Dj (case sensitive). It will propably be commented out as
#Dj$w.Foo.COM

The $w is replaced with your hostname. So if you remove the hash to activate
this line, the outgoing mail would be from `hostname`.Foo.COM and if you Change
then Foo.COM into second.domain it would appear to be from
`hostname`.second.domain.

Finally, if you also want the hostname to be different, then replace $w with
the name you want your system to be.

Best Regards,
Frank Timmers
Eivind Nordbye
New Member

Re: 2 Domains for 1 host?

If I understand you right, then you should use something like this in
/etc/nsswitch.conf:
hosts: files [NOTFOUND=continue UNAVAIL=continue TRYAGAIN=continue] dns

This will make hostname resolving look in /etc/hosts first, and if nothing is
found there, it looks into DNS. This is regardless of which
domain/interfacecard the request is coming from.