Using Raspberry Pi as a webserver
Ian Karley (65) 30 posts |
Hello all |
Steve Pampling (1551) 8170 posts |
You need the DHCP source to update the local name server (DNS) such that a ping to the name of the Pi will produce a response from the IP. i.e. It’s a function of the DHCP server and DNS rather than the Pi. |
Jan Rinze (235) 368 posts |
using the hosts file will help you. Also using a static IP-address would be required because the hosts file is not updated by DHCP. |
Jan Rinze (235) 368 posts |
Apart from doing the fixed IP your router may allow to reserve ip addresses based on the MAC address of your RPi. |
Steve Pampling (1551) 8170 posts |
Not really – the request was for information on configuration for a DHCP network:
So, suggesting NOT using DHCP is rather missing the point. For the record, more complicated DHCP/DNS configurations, like Enterprise server setups, can have a DHCP reservation with an entry to update DNS on behalf of the client. If the DHCP reservation supplies a name and the client machine does not the DNS entry is correct, if the client supplies a correct name the DNS name will be correct. How cheap the DHCP source actually is hasn’t been stated by Ian, but I assume that if his setup is rather obscure he will ask for more detail. Even the most inept implementations of client (usually medical equipment from large companies1) will have a correct DNS name in a properly configured DHCP network with half decent DHCP/DNS. 1 That’s cynicism from the day job and a decade or so of pointing out the correct way to do things. |
Jan Rinze (235) 368 posts |
@Steve: did not know the webserver is intended to run on a enterprise server setup. |
Steve Pampling (1551) 8170 posts |
We don’t know either way – but the request was for DHCP working. Mind you many modern home routers will do as I mentioned and provide a FQDN, in fact it is this without the shortname resolution that causes many home users problems. |