LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-03-2017, 05:49 AM   #1
vincix
Senior Member
 
Registered: Feb 2011
Distribution: Ubuntu, Centos
Posts: 1,240

Rep: Reputation: 103Reputation: 103
opendns query


When I try to find out my public ip address, I sometimes run the following:
Code:
dig +short myip.opendns.com @resolver1.opendns.com

To be honest, though, I don't really understand how this works, exactly. First of all, if I query another dns server, it doesn't work. But I don't understand exactly the mechanism. Why shouldn't it work, after all? If I run @8.8.8.8 would it mean, theoretically, that the returned ip would be 8.8.8.8 instead of my public ip?
 
Old 06-03-2017, 11:12 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Originally Posted by vincix View Post
When I try to find out my public ip address, I sometimes run the following:
Code:
dig +short myip.opendns.com @resolver1.opendns.com
To be honest, though, I don't really understand how this works, exactly. First of all, if I query another dns server, it doesn't work. But I don't understand exactly the mechanism. Why shouldn't it work, after all? If I run @8.8.8.8 would it mean, theoretically, that the returned imyip.opendns.comp would be 8.8.8.8 instead of my public ip?
What the command above does, is to query the opendns resolver for the IP of myip.opendns.com.

I guess myip is a special hostname (aliased maybe to a script), that makes opendns return the IP of the client issued the query. That's why it doesn't work using a different resolver.

Regards
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
openDNS salemeni LinuxAnswers Discussion 3 10-19-2011 01:14 AM
[SOLVED] Using OpenDNS in Slackware Cultist Slackware 2 10-04-2011 04:39 PM
Force openDNS Noahetrex Linux - Security 2 10-18-2009 09:14 PM
alternatives to OpenDNS? slackhack Linux - Networking 9 04-27-2008 08:24 PM
OpenDNS adriv Slackware 7 05-05-2007 06:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration