Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer
    
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 Aug 4 '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 Aug 4 '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 4 '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 Aug 5 '11 at 5:08
    
This is already answered here serverfault.com/questions/136332/… with also a reference to the documentation. Asking how to do this, is a new question you should create. –  mailq Aug 5 '11 at 8:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.