Can I give my iPhone a domain name?
So I'm using cocoahttpserver in my iphone application. I have the webserver working. But for now I need to identify my ip address and port number before an outside browser can access anything I create.
I would like to have my users connect via a human readable domain name. Even a domain name w/ the port appended would be acceptable.
I'm given to understand Bonjour allows for some degree of domain name resolution via mDNS. Is it even possible to use Bonjour to come to some solution here? I've been trying for some time, but I am running into a myriad of problems. Am I spinning my wheels? It does seem strange that temporary domain name resolution is possible. Any documentation, tutorials, or advice would be greatly appreciated. Thank you.
EDIT: Editing to be more clear, I apologize. I only require LOCALIZED domain name resolution. Doing it on a global scale would be folly for obvious reasons. But my app's need will not extend beyond a single wireless router.
EDIT: Unfortunately my question has not yet been answered. Here is another reference. Perhaps I didn't make my question clear enough originally. If anyone has advice on best practices to clean up a question, please let me know via comment.
EDIT: This question 开发者_Python百科does not seem to be of value. My true problem seems to lie in the cocoahttpserver implementation of Bonjour and mdns. It seems this problem can be solved, but it is fairly difficult and advanced, which made it hard for me to phrase the question. When I get the rep, I'll recommend this question for removal. Thank you to all who tried to help.
It sounds like you're looking for a dynamic DNS client for iPhone. A couple quick Google searches turned up these:
iDynDNS: http://code.google.com/p/idyndns/
EasyDNS: http://gavcode.wordpress.com/2010/05/13/automatic-easydns-on-iphone/
List of dynamic DNS providers: http://dnslookup.me/dynamic-dns/
Technically, you can; and here is a related video.
The idea is that hosting a domain would need a static IP address. A static IP addresses needs to be assigned by your ISP, or a dynamic ISP provider.
As long as you can bind one particular IP address to your iPhone, every kind of application/web hosting can be done.
Note, your iPhone will have to stick in once place to keep the same IP address.. If you move around between different WiFi spots for example, your IP address will constantly change making the hosted website or service unreachable.
Advise: Forget about it :)
If it's feasible, you could set up your own domain server, put the iPhone's IP address in that, and have the local machines refer to that DNS server first. Of course, I suspect you don't have an local servers of any description -- that's why you'd be using your iPhone, of all things, as a server; if so, you'd have to fall back on one of the dynamic DNS solutions alberge mentioned or just hand-edit the /etc/hosts file on every local machine.
精彩评论