Seems like you don't fully understand what DNS does...
When you type a URL in to a web browser or any other program, it goes out to a DNS server which in a home-type environment would be a server owned by your ISP or in a corporate environment, the company usually has its own DNS server.
Step 1: type in URL
Step 2: it calls up the dns server
Step 3: the dns server sends the computer the ip address setup for that domain
Step 4: the browser now requests the web page from that ip address
Step 5: apache checks to see if the domain name matches any domains set up on the server
Step 6: apache connects the browser to the appropriate virtual host.
So by setting a domain name on the web server, you effectively do absolutely nothing, without a record set up in the DNS server. With that said, you have some options.
The easiest, but possibly least effective, method is to edit the hosts file on whatever devices you know are going to access the web server. The hosts file is essentially a file which overrides the dns server for specific domain names. So right now I'm on a windows machine to edit my hosts file, I would browse to C:\Windows\System32\drivers\etc and open a text file which is called hosts. In there there are lines that look like this:
What that line says is: when someone tries to connect to the domain "localhost" connect them to the ip address 127.0.0.1
You can add a bunch of those lines if you want to, so on any computer you could add a line something like this... I'm using 192.168.1.102 as an example IP address for the sheeva.
Now, every time you enter www.ibug.plug into a web browser on the computer whose hosts file you just modified the browser takes you to 192.168.1.102.
Since Mac OS X likes to dumb things down, there is a GUI manager to do this task with the instructions found here: http://support.apple.com/kb/TA27291
Now I recognize that the place you really want to do this is on your iphone. To do this, the iphone needs to be jailbroken. Once jailbroken, you SSH into it and in either the /etc/ or /private/etc/ directory there is a hosts file. Use whatever text editor exists from the iphone terminal to edit it.
It should also be pretty easy to find on any other device/operating system.
I'd say that's accurate! I sort of understand the concept on the world wide web but I guess I thought that setting this in the config file would inform my home network router of the domain. Same way as it knows when I type 192.x.x.x that it shouldn't look outside of my network, but instead inside.
Originally Posted by PaulF
I suppose doing something like that requires me to change the settings in the router and give the plug a static IP?
I doubt that your router will have a setting for it. If you want a domain name to be known to all devices on the network, you would have to set up your own DNS server on the network. The router might have one built in, but I have my doubts on whether there is a way to put your own values into it. The router, will definitely have a DHCP server in it, the DHCP server informs all of the computers on the network what they should use as an ip address, the subnet mask, the gateway, and the dns servers. Remember how I said before that companies have their own DNS servers? You can set up the sheeva plug as a DNS server, then set it as the DNS server in the router and restart/reconnect all devices using the router. From then on, all the devices would look to the sheeva for a list of addresses and would see any custom addresses you put in.
If the sheeva is a server of any sort, it should definitely have a static IP.
There might be a way to do this by using the OpenDNS service. I'll check it out when I get home.
The plug will always have a static local IP which you can use if you're trying to run it from the local network, and as long as you don't keep plugging/unplugging devices into this network causing the IP to get rearranged.
After that you can set up bind9 to completely manage your DNS for you locally on top of Apache.
How is the Sheeva connected to the internet? What other devices are on this connection? How is it all hooked up?
There may be an easy way out of this.
Bugbyte, are you planning on using a router in the car too, or making the sheevaplug the center of the universe and being the router as well? If it's going to be the center of the universe for the car, you'll want to install a dhcp server and dns server on it as PaulF says. But if you give us more info we can give better advise.
I think either way you will want to configure it to have a static IP. To do this with debian/ubuntu, edit /etc/network/interfaces and add something like
iface eth0 inet static
Until you have a dns server in the environment you are using this in, you can an entry in your hosts file to map names to IPs. I have not hacked my iphone so I don't' know if it's the same as regular OSX (but should be) but edit /etc/hosts and add
I'm going to try pay attention to this thread and your iphone one and perhaps get a shivaplug as well since I am very interested in this as a permanent "always on" carputer and then using others to boot up when the vehicle is running (maybe using tftp even) to provide additional services.
If anyone has info on good DC-DC power supplies to provide 3v and 5v to multiple devices please let me know. It seems you'll need a powered hub at a minimum to do anything useful with this.
I must ask: why even bother using DNS if its a simple internal network?
Just hit the server directly with the IP address, bookmark it in a browser.
using direct TCP/IP will be faster than doing a DNS lookup even if it is local, since hitting the IP direct will essentially cut out a few networking steps ;)
Cool device BTW!!
Also remember to open up port 80 for the server IP in your router so the iPhone can access the web server.
You know, mainly for the 'cool' factor. I thought it would be neat to have the Sheeva named rather than put in the IP. Also, I was worried that if I set up everything based on the I.P. that it might get rearranged at some point in the future and thus by looking up the name rather than relying on the IP, it wouldn't 'bust' stuff in the future.
Right now the Sheeva is plugged directly in to my WiFi router. It is issued an IP from the router. Some of the computers on my network are also plugged into the router, but others access it via the WiFi connection. I haven't noticed any differences in accessing the Sheeva from A) a wired connection; B) a WiFi connection; C) a terminal program on my iPhone; D) the browser of my iPhone. All work identically.
For in-car setup, I intend to have the following:
1. Sheeva plug
2. WiFi router
3. USB hub with devices attached
An alternate setup would use a USB WiFi dongle instead of the router.
The Sheeva will function as the center of the car hotspot. It will:
1. Serve web pages to the iPhone
2. Run php (possibly java) or Perl
3. Interact with the USB devices
The purpose will be to allow control of and interaction with external devices from the iPhone, preferrably from a web page or simple java app.
The Sheeva will do the work of interfacing and translating inputs and output to/from the iPhone. Effectively, it will be an iPhone server.
I think it would make the most sense to use a usb wifi dongle (and bluetooth even) instead of also having a router since it really isn't needed. You'll want to have the sheevaplug be the dhcp and dns server which are both easy to do. Once you have that setup you can use a name as well.
I assume once the ad-hoc wifi network is in place, the sheeva can use the iphone for network access as well which would be pretty cool.
I personally would use python before java, but perl or php should do fine as well.
Time to order a sheevaplug and a FusionBrain for myself I think :)
That's awesome, nice integration.
I would still run static IP's assigned to specific MAC addresses, it will never get rearranged that way. It will also filter out would be war drivers from hacking your bug in the parking lot :)
I however cannot deny the coolness factor with giving your CARNET server a name.