Hi to all I have developed a project with arm Cortex m-3 (LPC series) equipted with tcp/ip and i connected a modem router to it with CAT5 cable .When I would like to connect to my device from another city I must buy and set the Static ip address on the router and do port forwarding to access to my device.i want to send microcontroller public ip address to the web service every time the device is reset or turn on. Does any one know how can i use Dynamic DNS in my microcontroller and give me a light on this way in oredr to decrease the price of project via removing static ip address?
John you have completely changed my question. I said i developed an embedded system using LPC17xx (cortex-m3) equipted with TCP/IP and want to find its public IP address on the internet. I connect it to modem router and bought an Ip static for monitoring and control my embedded system (LPC17xx) from another city.I looking forward to find a way for connecting to my microcontroller(NOT COMPUTER) without IP STATIC .Like a DDNS for CCTV. I read all your answers.Have you give a best and perfect guidance document for doing so?
If you have a COMPUTER connected to the internet, how do you find the public IP address of that?
You normally don't. Why? because the computer connects to the internet via a router.
It is the router that is connected to the internet. It is the router that has the public IP address.
Frequently, any device connected to the router (on the 'home' side') uses a local IP address provided by the router.
This scheme is generally seamless when your computer makes a connection with the outside world. If you want to talk to your computer FROM the outside world, you need to specify a forwarding rule on the router. From the outside, you make a connection to the public address of the router and the router passes the traffic onwards to your computer.
So, what you do is find the public IP address of the router.
Now, as has been mentioned a number of times on this thread, replace the word COMPUTER with 'your device' or 'LPC17xx'. You should realise that you still need to know the public IP address of your router. Your device has NOTHING to do with it.
So, look in the documentation for your router and figure out how to use DDNS or whatever you think is most appropriate.
It's really VERY simple.
Thank you man this is your best answer.Thanks