Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Servers & Networking
FedoraForum Search

Forgot Password? Join Us!

Servers & Networking Discuss any Fedora server problems and Networking issues such as dhcp, IP numbers, wlan, modems, etc.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 6th June 2006, 02:26 AM
PilotJLR's Avatar
PilotJLR Offline
Registered User
 
Join Date: Nov 2005
Location: flying a cubicle
Posts: 465
How to resolve IP addresses into the domain name?

I know there's a simple answer to this, but I haven't been able to find it...

Can anyone remind me how to resolve an IP address into a domain name / FQDN. In other words, something to let me know IP address 1.2.3.4 is really mydomain.com.
I know there's websites that do this, but there's also a command utility... that's what I'm looking for.

Thanks!
Reply With Quote
  #2  
Old 6th June 2006, 02:36 AM
William Haller Offline
Registered User
 
Join Date: Jul 2005
Age: 52
Posts: 1,013
nslookup x.x.x.x

or, as an alternative

whois x.x.x.x
Reply With Quote
  #3  
Old 6th June 2006, 02:42 AM
PilotJLR's Avatar
PilotJLR Offline
Registered User
 
Join Date: Nov 2005
Location: flying a cubicle
Posts: 465
Ah ha! I tried nslookup a few times before, no luck on that. But whois works perfectly. Thank you!!
Reply With Quote
  #4  
Old 6th June 2006, 08:43 AM
ccrvic Offline
Registered User
 
Join Date: Apr 2006
Posts: 1,092
Quote:
Originally Posted by PilotJLR
Can anyone remind me how to resolve an IP address into a domain name / FQDN
If there's a PTR record in DNS, use "dig -x a.b.c.d". If there isn't, you need whois to tell you about the netblock it's in...

Vic.
Reply With Quote
  #5  
Old 6th June 2006, 01:48 PM
ibbo's Avatar
ibbo Offline
Registered User
 
Join Date: Jun 2005
Location: Leeds
Posts: 1,264
if you have mysql installed then you should have resolveip.

Its fully backward forward I.E 192.... would give domain name while domain name will give IP.

Fiiling that compile this

Code:
#include <stdio.h>          /* stderr, stdout */
#include <netdb.h>          /* hostent struct, gethostbyname() */
#include <arpa/inet.h>      /* inet_ntoa() to format IP address */
#include <netinet/in.h>     /* in_addr structure */

int main(int argc, char **argv) {
            struct hostent *host;     /* host information */
            struct in_addr h_addr;    /* internet address */
            if (argc != 2) {
              fprintf(stderr, "USAGE: nslookup <inet_address>\n");
              exit(1);
            }
            if ((host = gethostbyname(argv[1])) == NULL) {
              fprintf(stderr, "(mini) nslookup failed on '%s'\n", argv[1]);
              exit(1);
            }
            h_addr.s_addr = *((unsigned long *) host->h_addr_list[0]);
            fprintf(stdout, "%s\n", inet_ntoa(h_addr));
            exit(0);
}
It only return the IP from the domain I.E nslookup google.com returns 72.14.207.99

Ibbo
__________________
A Hangover Lasts A Day, But Our Drunken Memories Last A Lifetime
--
Linux user #349545
(GNU/Linux)iD8DBQBAzWjX+MZAIjBWXGURAmflAKCntuBbuKCWenpm XoA7LNydllVQOwCfdjyzXscddzQvlhBedAcD7qfKmHo==zx0H
Reply With Quote
  #6  
Old 26th April 2010, 07:42 AM
aleph's Avatar
aleph Offline
Banned (for/from) behaving just like everybody else!
 
Join Date: Jul 2007
Location: Beijing, China
Posts: 1,307
linuxfedorafirefox
Re: How to resolve IP addresses into the domain name?

dig -x [IP ADDR]
__________________
I believe in nerditarianism. I read FedoraForum for the Fedora-related posts.
Reply With Quote
Reply

Tags
addresses, domain, resolve

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
yum could not resolve path ashwanis10 Using Fedora 1 2nd April 2009 08:16 AM
Apache server can't resolve domain name philwynk Servers & Networking 7 14th November 2008 01:02 PM
Domain names fail to resolve, but IP addresses ok munkee Servers & Networking 8 16th April 2007 06:14 PM
Can't resolve domains. pdeman2 Servers & Networking 23 10th June 2006 03:50 AM
Unable to resolve IP addresses pinenut Servers & Networking 15 2nd March 2006 11:28 AM


Current GMT-time: 00:27 (Thursday, 23-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat