Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7805647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T02:17:20+00:00 2026-06-02T02:17:20+00:00

Is there a way to get the public DNS of an EC2 instance using

  • 0

Is there a way to get the public DNS of an EC2 instance using PHP amazon SDK (or amazon’s API command line tools)?

I tried this PHP code (among others) but it won’t work:

require_once '/full/path/sdk.class.php';
$ec2      = new AmazonEC2();
$response = $ec2->describe_regions();
print_r($response);

and also

require_once '/full/path/sdk.class.php';
$ec2      = new AmazonEC2();
$response = $ec2->describe_instances(array(
    'Filter' => array(
        array('Name' => 'availability-zone', 'Value' => 'eu-west-1')
    )
));

print_r($response);

but I can’t see the public dns in the response

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T02:17:21+00:00Added an answer on June 2, 2026 at 2:17 am

    Apparently you’d like to retrieve your Amazon EC2 instance in region eu-west-1 (which isn’t a correct value for ‘availability-zone’ btw.). However, you are not specifying any region and all services default to the US-East region, see the AWS team response to the related question describeInstances() is only giving me instances in us-east:

    While you can’t grab data for all regions in a single call, you can
    call the describe_instances() method in each region.

    $ec2 = new AmazonEC2();
    $ec2->set_region(AmazonEC2::REGION_US_W1); // US-West 1
    
    $response = $ec2->describe_instances();
    

    Using this code with the appropriate constant for your region of choice (e.g. AmazonEC2::REGION_EU_W1) should yield the desired result.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to get the following function declaration? public bool Foo<T>() where
Is there a way to get Windows audio mixer levels using WMI? For example,
Is there a way to get all versions of list item(s) using a CAML
Is there a way to get an associated icon in C# without using any
having the method public void foo(){ //.. } Is there a way to get
Is there any way to get certificate detail from public key? I had to
Is there a way to get all methods (private, privileged, or public) of a
Is there a way to get the SearchPath API to not search in c:\windows
Is there a way to get a list of all public Facebook applications and
Is there a way to get the size of a remote file like http://api.twitter.com/1/statuses/public_timeline.json

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.