0

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.

Mahendra Liya
  • 339
  • 1
  • 5
  • 13

1 Answers1

1

Your hostname shouldn't be www.mydevice.com, but it should be www in this case. mydevice.com is your domain and should be the domain name of your home network.

Both udhcpd and dnsmasq 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 like local.mydevice.com. Otherwise you get in trouble with conflicting public and private DNS entries.

mailq
  • 16,882
  • 2
  • 36
  • 66
  • hey, thanks for your answer... You seem to be pointing me on the right track... when my hostname is set as `www.mydevice.com` it shows the terminal prompt as `root@www.com`... which means my hostname is taken as `www` as you are saying.. – Mahendra Liya Aug 04 '11 at 14:01
  • Can you suggest me what settings / configurations should I do to access the website running on my embedded device after it gets connected to the local wireless network...? – Mahendra Liya Aug 04 '11 at 14:08
  • 1
    Why should that be different? Configure your DHCP server to give out an IP for that hostname and then access it via the hostname. Nothing special. – mailq Aug 04 '11 at 14:12
  • +1 for that comment... I understand this, but can be kind enough to suggest me as to how can I configure my DHCP server to give out an IP for that hostname? – Mahendra Liya Aug 05 '11 at 05:08
  • This is already answered here http://serverfault.com/questions/136332/setting-up-dnsmasq-for-a-local-network with also a reference to the documentation. Asking how to do this, is a new question you should create. – mailq Aug 05 '11 at 08:24