Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Feb 2016 17:05:34 +0100
From:      Polytropon <freebsd@edvax.de>
To:        JosC <bsduser@cloudzeeland.nl>
Cc:        "freebsd-questions@FreeBSD.org" <freebsd-questions@freebsd.org>
Subject:   Re: Hosts
Message-ID:  <20160228170534.f41eaef7.freebsd@edvax.de>
In-Reply-To: <56D2C3E0.8030406@cloudzeeland.nl>
References:  <56D2C3E0.8030406@cloudzeeland.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 28 Feb 2016 10:54:40 +0100, JosC wrote:
> Is there a wayI can link domain names to MAC addresses instead to IP 
> addresses?

No, host names are bound to IP (as MAC addresses are a different layer).



> Used to give some internal harware fixed ip's and described that in my 
> /etc/hosts file, but as for some I use DHCP, I cannot use that anymore.

You can use a "cascaded approach". If you use DHCP to provide IP
addresses, provide them on the basis of MAC addresses. You can
do that with the dhcpd.conf configuration file:

	host domain1 {
		hardware ethernet 00:12:34:56:78:90;
		fixed-address 192.168.1.101;
	}

	host domain2 {
		hardware ethernet aa:bb:cc:dd:ee:ff;
		fixed-address 192.168.1.102;
	}

Then you can use those addresses in the hosts configuration file:

	192.168.1.101	domain1.example.com	domain1
	192.168.1.101	domain1.example.com.

	192.168.1.102	domain2.example.com	domain2
	192.168.1.102	domain2.example.com.

So the MAC 00:12:34:56:78:90 will be associated with domain1.example.com,
and aa:bb:cc:dd:ee:ff with domain2.example.com.

I hope I didn't misinterpret your question. Is that what you were
searching for?




-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



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