I'm working with a brain dead system, so bear with me...
I need a way to do a DNS lookup of an IP address that returns the IP address. I can control the DNS server, and/or possibly apply a suffix to the IP address.
The reason is that I have an industrial unit that will accept a hostname (for FTP purposes) but if I enter an IP address it fails, and this appears to be because its DNS lookup of that address is failing. The unit should have Internet access and I can set the DNS server to whatever I like, so one option would may to run my own DNS server that when queried for "192.168.1.1" returns the IP address "192.168.1.1". That pre-supposes that the unit isn't already detecting that "192.168.1.1" is an IP address, not doing a DNS lookup, but then failing for some other reason (where it does not fail if I use a name which looks up to that IP).
A "better" solution is probably to apply a suffix, so instead of entering "192.168.1.1" I enter "192.168.1.1.example.com" [1] where the DNS for "example.com" will return the IP address. That way I know that the unit will be forced to go through a DNS lookup and is more likely to just work. I'd just need some guidance on setting up BIND or some other DNS to achieve this.
Any ideas?
The "best" option would be to get the manufacturer to fix their product but it turns out that the best options aren't always available :-(
[1] Just for clarity: the user enters the IP address and I have no control over what address they'll enter. In my code I then detect that it's an IP address rather than a hostname (probably just checking whether the last character is numeric would suffice), and appending ".example.com" before passing to the FTP handling code.
-- Mark Rogers // More Solutions Ltd (Peterborough Office) // 0844 251 1450 Registered in England (0456 0902) 21 Drakes Mews, Milton Keynes, MK8 0ER