3

I have a LAN at home sitting behind the router (Linksys WRT54G). The IP addresses assigned to the Linux boxes are

  • 192.168.0.101
  • 192.168.0.102
  • 192.168.0.103

The Router is also connected to the modem provided by my ISP, to access the internet. Now, the router is assigned the IP address 192.168.0.1 and is also configured to start assigning IP addresses starting from 192.168.0.100 using DHCP protocol.

Now I have an application which requires to have FQDNs (Fully Qualified Domain names) for like each machine - something like

  • phx1.mylocalnet.com
  • phx2.mylocalnet.com
  • phx3.mylocalnet.com

Is this possible to do?

4 Answers 4

1

… or you could keep all of your machines with dynamically-assigned addresses, and:

  • have local DNS servers providing split horizon DNS service, with all of your DHCP clients configured to register themselves with the local content DNS server when they obtain leases off the DHCP server; or
  • have local DNS servers, again providing split horizon DNS service, and a DHCP server (ISC's DHCP server for one can do this. Your router's DHCP server probably cannot.) that registers name→address mappings itself with the local content DNS server, directly, so that the DHCP clients don't have to.

The second has the considerable advantage that one only needs to give the DHCP server permissions to perform DNS updates, not every machine on the entire LAN. But it does lock you in to particular vendors' DNS servers. BillThor mentions dnsmasq, which is one of a few softwares that is both content DNS server and DHCP server all in one.

0

Look at dnsmasq to serve up DNS and cache DNS results. You can install this on one system and edit /etc/resolv.conf for other hosts. You can either use dnsmasq to replace your router as the DHCP server, or assign static addresses. For servers I would assign fixed addresses, client are fine either way.

0

First, you need to start by assigning them static IP addresses, or if your router supports it, you can give them a reserved IP address using your DHCP server. I would just assign them IP addresses out of the DHCP Server's range, like 192.168.0.21-23. This is so the IP addresses will not change, and break the next step. The other poster did not mention this.

Then, unless you want to also set up a DNS server (I agree with the other poster: Overkill), you will need to add the entries to the HOSTS file as he said.

0

There's several ways to do it, one being to setup one of your machines to be your nameserver (and have it tell your network phx1.mylcoalnet.com is 192.168.0.101, etc). This is a less hack-ey approach, but it's harder to implement and might be overkill.

An easier approach, would be just tricking the machine that hosts the FQDN-application using a hosts file (it exists on both Linux and Windows under /etc/hosts and Windir\system32\drivers\etc\hosts). If required, you could even add those same entries on all machines on your network.

This assumes my understanding of the issue is correct, and you do not actually have a real domain you'd like to use. If I've misunderstood you, then the solution would still be the first one, except you'd want to set that NS to be the primary nameserver for your domain.

You must log in to answer this question.