Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a application server (LAMP Stack) access. But php application connect to mysql from another db server. I have only private IP for this DB Server. Is their are any way to know public IP Address for this private IP address.

As this server is part of a AWS infrastructure, So by judging other servers, i am quite sure, that DB Server should have Public IP too.

I also checked with AWS Admin Panel, But their no private IP like this DB Server registered.

share|improve this question

closed as off-topic by Jenny D, Falcon Momot, freiheit, mdpc, Ladadadada Jan 7 at 17:56

This question appears to be off-topic. The users who voted to close gave these specific reasons:

  • "Questions must demonstrate a minimal understanding of the problem being solved. Try including attempted solutions, why they didn't work, and the expected results. See How can I ask better questions on Server Fault? for further guidance." – Falcon Momot, freiheit, Ladadadada
  • "Questions must be relevant to professional system administration. Server Fault is dedicated to professional system and network administrators. End user and enthusiast questions are off-topic (contact your system administrator or hire a professional to help you out). Please see the Help Center for more information." – Jenny D, mdpc
If this question can be reworded to fit the rules in the help center, please edit the question.

1  
Exactly what are you trying to do? If both of these servers are within AWS, then you probably do NOT want to use the public IP address. –  Michael Hampton Dec 31 '13 at 8:15
    
I need to access that server for information gathering for future migration perspective, I already have some common user access details which I plan to try against that server when public ip will be known. –  kuldeep.kamboj Dec 31 '13 at 8:57

2 Answers 2

up vote 2 down vote accepted

A few possible ways:

  1. Look at the output of ifconfig to see if a public IP address is listed.
  2. See if you've been given a public hostname that you can resolve to a public IP address.
  3. Run curl icanhazip.com on the server, to get back your public IP address (or use other similar services).
  4. Ask the hosting provider.
share|improve this answer
    
First approach requires to have a ssh, Alas Its is MySQL Server So second approach not works here, For whatismyip.com, I do not think they will work for private IPs. –  kuldeep.kamboj Dec 31 '13 at 10:26
    
Problem fixed. DB server is a RDS Instance and When I tried ping on all my RDS URL one-by-one from one of applications server, It give private IP same as required for one of RDS. As AWS Panel did not have information about Private IPs for RDS it taken so long to resolve issue. –  kuldeep.kamboj Dec 31 '13 at 13:55
1  
curl icanhazip.com is the best version of option 3. above. Using curl means not having to install X and a browser. The response from that site is nothing but the IP address. No need to grep through html. It's run by Major Hayden of MySQLTuner and Racker Hacker fame. –  Ladadadada Jan 7 at 17:55
    
Nice. I edited my answer to use that instead. –  Andrew Schulman Jan 7 at 20:21

I had the same issue with GoDaddy, needed to access the DB from public internet, and they provide me with a hostname that I can use from public internet. I agree with other answer, ask the provider for public access to the DB.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.