I am running Lighttpd 1.4.28
on an embedded device. Apart from the webserver, I run udhcpd
and dnsmasq
to allow other devices to connect to my embedded device to access the website.
My device has the capability to join other networks. So when I make my embedded device join my local home wireless network, I am able to access the website with the IP obtained by this device after joining the local home network, but not by the hostname.
When I join the local home network, I kill the udhcpd
server as my local home network has a DHCP Server and DNS Server running which automatically assigns the IP.
I pass the hostname of my device when requesting IP through udhcpc
as:
udhcpc -h "www.mydevice.com"
My problem is I am only able to access the website running on the device as :
http://192.168.100.101/index.html
and not as:
http://www.mydevice.com/index.html
Can anybody tell me where am I going wrong? Am I missing something?
Thanks.
Your hostname shouldn't be
www.mydevice.com
, but it should bewww
in this case.mydevice.com
is your domain and should be the domain name of your home network.Both
udhcpd
anddnsmasq
should be configured to this domain. Even your PCs should have been configured to this DNS domain name.Also make sure, that mydevice.com is not a real domain that has an own DNS server in the Internet. In this case you should either name it to something unreal like
mydevice.invalid
or create a subdomain for that purpose likelocal.mydevice.com
. Otherwise you get in trouble with conflicting public and private DNS entries.