How to set ServerName on home network

Are you asking a Multicast DNS (aka mdns) question?

FreeBSD link here: https://wiki.freebsd.org/MulticastDNS

If you mean in a "Windows" context - SAMBA usually sends out the appropriate stuff and pretends to be a "Windows Active Directory". Here is a link that is for FreeBSD: Samba 4 AD on ZFS

The way you have written "ServerName" makes me think you mean Apache Web Server -- and you can add a DNS entry your local DNS server zone file or to a local /etc/hosts file. Though on local LANs a lot of people are (also?) using Zero Conf solutions these days like mdns.

Sorry -- "Apache" -- can mean a lot of different things these days :cool:
 
Many, many years ago I set up an "authoritative" domain with a bogus TLD .home. For multiple reasons, the first was that I wanted to learn about DNS and how it worked. The second reason was to have something I could use for my homelab to register all sorts of services, hostnames and whatnot, without actually having to properly register a domain. And the third reason was that FreeBSD had BIND named in the base at that time. So I had all the tools I needed already available to me.

Should still be fine to use as a TLD. Then set up something like balanga.home. And you can create A (and/or AAAA) records for myserver.balanga.home for example. Not suggesting setting up BIND but there are other (probably easier to use) alternatives.

Or, you could go with a hosts file option of course, but the downside of it is that you have to distribute that hosts file to every computer on your network.
 
Not sure.. (by my read?) was the OP wanted (other hosts) on his LAN or network to locate his web sever. 127.0.0.1 will work find if you are just running a local web server you only plan to use with your FreeBSD host.

Change: 127.0.0.1 to the IP Address to the desired Ethernet/Wifi/etc card if you want to allow other hosts to be able to access it. Also remember to punch a firewall hole using PF (or similar) if you are using a firewall.
 
Many, many years ago I set up an "authoritative" domain with a bogus TLD .home. For multiple reasons, the first was that I wanted to learn about DNS and how it worked. The second reason was to have something I could use for my homelab to register all sorts of services, hostnames and whatnot, without actually having to properly register a domain. And the third reason was that FreeBSD had BIND named in the base at that time. So I had all the tools I needed already available to me.

Should still be fine to use as a TLD. Then set up something like balanga.home. And you can create A (and/or AAAA) records for myserver.balanga.home for example. Not suggesting setting up BIND but there are other (probably easier to use) alternatives.

Or, you could go with a hosts file option of course, but the downside of it is that you have to distribute that hosts file to every computer on
Local unbound allows to set your specific records , for your PC.
For being public on internet ,i don't know , how it goes, as far as I know , it depends ...
 
The way you have written "ServerName" makes me think you mean Apache Web Server -- and you can add a DNS entry your local DNS server zone file or to a local /etc/hosts file. Though on local LANs a lot of people are (also?) using Zero Conf solutions these days like mdns.
That's exactly what I'm looking for. I want a simple solution. I'm running in a jail so would like to access the server from anywhere on my network.

I do have a dhcp server and I would try assigning an IP address and hostname via MAC address, but don't know if I can do that in a jail.

Zero Conf solutions are something I know nothing about.
 
Not sure.. (by my read?) was the OP wanted (other hosts) on his LAN or network to locate his web sever. 127.0.0.1 will work find if you are just running a local web server you only plan to use with your FreeBSD host.

Change: 127.0.0.1 to the IP Address to the desired Ethernet/Wifi/etc card if you want to allow other hosts to be able to access it. Also remember to punch a firewall hole using PF (or similar) if you are using a firewall.
Using IP address works, but I'd like to use a hostname. Getting assigned by the network would be my preferable solution
 
I do have a dhcp server and I would try assigning an IP address and hostname via MAC address, but don't know if I can do that in a jail.
While that would give the host a proper hostname and IP address, that relationship (hostname to IP address) isn't known to any other computer on your network. That's what DNS is for. Didn't you recently set up dnsmasq? You can set up an 'authoritative' DNS with that too.
 
While that would give the host a proper hostname and IP address, that relationship (hostname to IP address) isn't known to any other computer on your network. That's what DNS is for. Didn't you recently set up dnsmasq? You can set up an 'authoritative' DNS with that too.
Yes I have dnsmasq running, but have only set it up for assigning IP addreses for known MAC addresses. I don't know if I can do that with jails.
 
I have a simple split, DHCP is used for workstations, laptops, phones, that sort of thing. Servers (and their services) have static IPs.

I also have my home network split up into different VLANs. But that's really not necessary, I didn't have them when I first set up my "homelab". Just a single /24, used addresses .10 to .150 for DHCP (workstations, desktops, laptops) and .200 and up for my "servers" (only had 2 at the time, my firewall and a doing-everything server).
 
I run local DHCP and DNS with a made up home domain. For my static IPs I let the DHCP server set a fixed address (name) based on the mac address of the device connecting and then that name is being translated to an ip by the DNS server.

This is to have all devices on DHCP but still control what devices that get static IPs (or not).

/grandpa
 
I simply resolve all my internal names through the /etc/hosts file on my openWRT firewall, where I also resolve all external DNS inquires. If the hostname lookup is without a domain then it resolves to an internal host.

Apache virtual hosts will use the hostname supplied in the URL to choose the correct document area, as long as all necessary hostnames are aliased to the apache server.
 
I run local DHCP and DNS with a made up home domain. For my static IPs I let the DHCP server set a fixed address (name) based on the mac address of the device connecting and then that name is being translated to an ip by the DNS server.

This is to have all devices on DHCP but still control what devices that get static IPs (or not).

/grandpa
The problem I'm having is knowing how to set an IP address for a jail since it does not have a MAC address.
 
The problem I'm having is knowing how to set an IP address for a jail since it does not have a MAC address.
I'm not a network and FreeBSD expert, but for mine homelab I used:
  • VNET for jails, because it creates a distinct network interface for each Jail, with a proper MAC address. The IP-Sharing method can create problems, because it uses tricks on the localhost-like IP. VNET is instead a standard network configuration, and it is all rock-solid.
  • I use Bastille and I assign the IP address statically. This probably is not optimal.
  • a DHCPD server.
  • the full dns/unbound service on ports (not the one on the base system, because it is limited) for associating to each IP something like "myservice.local.lan".
  • I use the dns/unbound service as DNS server of each jail and computer, so I have: local.lan name resolutions; fast DNS caching; etc..
  • I use quad9.net for DNS forwarding, because someone suggested me, and it seems good.
  • I configured some routing rule for WiFi devices connected through my WiFi modem.
This configuration is for sure overly complex. Probably it is better using some more modern zero-config solution. But I like it because it is stable, and it uses standard networking tools.

In case you are interested, I can prepare a blog post with the details of the configurations.
 
Back
Top