Hi Mehmet,
"Mehmet Fide" <off at a dot net> wrote in message
news:949163 at forums dot embarcadero dot com...
Hi,
We have a product called gateway that reads smart electricity meters
through RS485 bus and can ship all related info to the customer via
GPRS. Our gateway does that by providing a TCP server service to the
customer. So customers have to connect to the gateway.
Since GSM providers here ask for extra fee for static IP, our gateways
use dynamic IP on the internet side and that makes them unreachable for
the customers because their IPs are changing frequently.
I think you mean because your IP changes frequently? A customers IP being
changed would not stop them making an outbound connection to your network.
So, what I thought that Indy may help here and we can develop a service
for a DNS server that manages each gateways domain name like that:
For example company domain: mycompany.com
gateway1.mycompany.com will be assigned to first gateway and whenever the
gateway address changes on the GPRS side, the gateway updates its IP
through our custom DNS server service.
gateway2.mycompany.com, gateway3.mycompany.com and so on for each
gateway.
You realise that you will need to run this on an external server that is
already online such as a vps or dedicated server? - which will already have
a static IP address..
For that purpose, I've checked Indy component pallet and found
TIdDNSServer that makes me happy because the name is exactly what I
want

Delphi now supports Linux that makes me two times happy.
While Remy and the indy pit crew mean well with their offerings,
TIdDNSServer isn't much use to anybody. It supports minimal features, has no
documentation, no support for authoritive name servers (or results) etc.
Even the TIdDNSResolver / Client has no support for authoritive answers. It
just bundles them together and spits them out as one set of answers which IS
usable but isn't ideal.
What you need to do is look at using raw udp / tcp (the dns protocol is the
only one to use both). It can be done with Indy using TIdUDPServer (and
TIdTCPServer) but you need to be good with low level packet data and byte
manipulation etc.
This is a page that will get you started - I stumbled on it purely by
accident but it is a gold mine (you'll need to run it through google
translate):
http://www.delphipraxis.net/599692-post5.html
Some of the code you will need is missing though - thats the minimal amount
of code so you'll have to write the rest.
You can also find more information on the packets themselves at
http://www.tcpipguide.com
The problem is that I couldn't find any example or documentation about
TIdDNSServer component, how to use it or does it really suits our
requirements. I'm not an expert at DNS protocol, I only know that DNS
server uses UPD and I need to add Host (A) record.
There are minimal samples for Indy 10 out there. Seems a bit pointless
releasing a socket suite of components with no clues how to use them but
thats how things have gone with Indy. The good old days of Indy 8 had loads
of samples, 9 came with a few (but no TIdDNSServer- which was introduced in
v9) and when 10 came out moons ago it seemed like the pit crew completely
gave up on the idea of samples.
When i created my dns nameserver using the two links above (yes it can be
done in delphi!) i had a lot of trial and error to go through so it would
have been handy if Indy did come with a good component and demo for it.
Connect with Us