Local unbound allows to set your specific records , for your PC.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
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.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.
Using IP address works, but I'd like to use a hostname. Getting assigned by the network would be my preferable solutionNot 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.
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.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.
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.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.
I would need to maintain a hosts file on every system on my network.
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 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 am using dnsmasq which is a dns server but not sure how to assign hostnames to specific IP addresses.You could install one central dns server , it will consolidate all /etc/hosts files , then redirect all dns request on all servers to it.
Central configuration.
I'm not a network and FreeBSD expert, but for mine homelab I used: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 definitely interested in how to obtain a proper MAC address in a jail. I use IOCAGE if it makes any difference.I'm not a network and FreeBSD expert, but for mine homelab I used:
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.
- 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.
In case you are interested, I can prepare a blog post with the details of the configurations.
You can configure dnsmasq to use the /etc/hosts file for lookup as well. That's the common openWRT configuration for my version and its how I resolve all my internal network hostnames.I am using dnsmasq which is a dns server but not sure how to assign hostnames to specific IP addresses.
How does that work if I have several systems, some with jails?You can configure dnsmasq to use the /etc/hosts file for lookup as well. That's the common openWRT configuration for my version and its how I resolve all my internal network hostnames.
Could you please name them? I can get me a list from ports(7) myself, but there'll be good ones and less good ones...ü... Not suggesting setting up BIND but there are other (probably easier to use) alternatives.
I reported a horrible bug in the default configuration of local-unbound(8) in FreeBSD more than 5 years ago. NOTE: This bug does not affect the upstream (genuine) unbound, instead just FreeBSD's configuration of it shipped as default in the base system. The upstream's genuine default configuration is clean!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 ...
Have you looked at dns/dnsmasq ?Could you please name them? I can get me a list from ports(7) myself, but there'll be good ones and less good ones...
NOTE: This is of low priority to me, you may answer in 2 months. But sooner or later I'd like to set up a "real" DNS for my home network, because the DNS server of my DSL router is very limited, it misses some entries I'd like to set like e.g. to boot via DHCP or to boot over network from the BIOS/UEFI. 25 years ago I had to administer a bind(8) for our customers, and I missed a GUI that really works. Hopefully, things have improved since.