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 8584393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:45:51+00:00 2026-06-11T21:45:51+00:00

I just like to ask if it is possible to identify the IP Address

  • 0

I just like to ask if it is possible to identify the IP Address of a device (e.g. a printer) using its Hostname even if its Bonjour setting is turned off? Also can you give me an example on how to do it? I am developing an app in iOS that should handle this scenario.

I have looked at the following:

  1. getaddrinfo
  2. CFHostStartInfoResolution

but they work only if the device’s bonjour is turned ON.

  • 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-11T21:45:52+00:00Added an answer on June 11, 2026 at 9:45 pm

    Assuming the hostname (let’s say nameOfTheDevice) is registered with the zone’s authoritative DNS server, you can use CFHost to look up an address or hostname. For example:

    NSString* hostname = @"nameOfTheDevice";
    CFHostRef hostRef = CFHostCreateWithName(kCFAllocatorDefault, (CFStringRef)hostname);
    
    Boolean lookup = CFHostStartInfoResolution(hostRef, kCFHostAddresses, NULL);
    NSArray* addresses = (NSArray*)CFHostGetAddressing(hostRef, &lookup);
    
    [addresses enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
        NSString *strDNS = [NSString stringWithUTF8String:inet_ntoa(*((struct in_addr *)obj))];
           NSLog(@"Resolved %d->%@", idx, strDNS);
      }];
    

    (Remember to put error checks in your production code). Bear in mind that if the DNS server isn’t aware of that hostname, there’s nothing you can do. It’s not safe to assume that you’ll be able to perform a successful lookup, especially on a home network where built-in DHCP/DNS servers have widely varying capabilities.

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

Sidebar

Related Questions

I would just like to to ask if its possible to insert a jQuery
I would just like to ask if it's possible for me to check the
I'd just like to ask if it's possible for widgets to have conditional visibility
just would like to ask if it is possible to manually populate the datagrid
I'd just like to ask about a problem I'm facing with Facebook Graph API.
Just a knowledge question which I would like to ask: For example, I have
I just want to ask if anybody has done something like this. Basically, it's
I would like to ask a really simple question. I am just passing a
I would just like to ask, is there a way to possibly customize the
I would like to know if it's possible to make a table resizable just

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.