Dig dual-stack details - stack

I want to see the ip details of a machine that has a dual-stack. I am using dig to do this using the options -A and -AAAA to get the individual answers, and was wondering if there isn't an option to get both of the results with just one query. Thx

I managed to find the answer . You have to use the -ANY flag to get both the ipv6 and ipv4 ip's. Hope this helps.

There is a duplicate question here:
Get IPv4 and IPv6 with one command
Where I've given the alternative answer:
dig hostname A hostname AAAA +short

Related

How to determine if a server is only accessible using IPv6

Using Delphi 7 with Indy10, I need to create an IPv6 to IPv4 proxy for a service that doesn't support IPv6. I can manage that fine. The only issue I'm facing is, if they enter a domain name rather than an IP address, how can I determine if the destination server is only accessible via IPv6 and not IPv4? If IPv4 is available, I would prefer to send the request directly rather than going through the proxy.
Is using TIdDNSResolver the only solution?
I found code for with 2 functions for using it, one returning an IPv4 and the other an IPv6 address. Presumably the IPv4 function will return nothing if there is only IPv6 available.
But the functions both require a DNS server to be specified. How am I to find one? Is there some way to use the default DNS server to find the IP addresses, perhaps using a Windows API and not Indy?
You actually have several questions in your question. I will answer this one: "How do I find a DNS server address?".
One answer is: call GetAdaptersAddresses in the IpHelper API. This call will return many addresses including the DNS address. In the documentation there is a C++ example you can translate to Delphi.
Another answer is to use command line IPCONFIG /ALL. In the output, you'll find the DNS address.
A third answer is to use a WMI query. See this question.

Ruby-on-Rails, Geocoding and IPv6

For years I have been determined a users location with the help of Geocoder, looking up the IPv4 address. By firing
request.location, I determined the location, and if the country was multilingual, I looked up the browser language setting to set the appropriate language. When I feed an IPv6 address to my Rails app, the IP address returns :::1, which isn't very helpful.
Unfortunately, IPv6 poses a challenge when it comes to determining a visitors location. Is there any proven way of working with IPv6 on Ruby-on-Rails?
I have googled my way through the internet but didn't come across a specific solution.
You can do this with the ipaddr library. It supports ipv4 and ipv6:
$ require 'ipaddr'
$ ipaddr = IPAddr.new "3ffe:505:2::1"
$ p ipaddr
#=> #<IPAddr: IPv6:3ffe:0505:0002:0000:0000:0000:0000:0001/ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff>
$ p ipaddr.to_s
#=> "3ffe:505:2::1"
If you want more advanced functionality, try the ipaddress gem which also supports ipv6.
You can use Geocoder.search() to search by an ipv6 address:
Geocoder.search(ipaddr)
Geocoder.search('2607:fea8:1360:f7d:dce7:b7f0:e0b6:1014')

Is it possible two hostnames share the same IP address?

I'm confused whether is it possible that two hostnames share the same IP addresses? And why?
What about if one hostname represent more than one IP address, is it possible too? And why?
detailed explanation is really appreciated :)
I know of Apache Virtual Host, which allows webservers with different hostnames (domainnames), to be hosted on the same IP address.
The webserver sends the domainname we wants while connecting, and webserver returns the right set of pages.
Heres something more specific if you want to further look into it https://httpd.apache.org/docs/2.4/vhosts/examples.html

Find public IP address of the session user in Grails

I want to request the remote address of the session user in grails. I found a question here which describes the problem (Grails find public IP address of the session user) and the answer really works. I use only request.getRemoteAddr() and I receive 0:0:0:0:0:0:0:1 in my localhost.However, what I have to do to see the real IP address of the user?
In this previous question which I have found it is said "Try looking at the output of request.remoteAddr when viewing the site from a different computer". I really don't know what this means and I need your help here. I can load the server only in my own browser and I use "localhost:8080/..."
Please,tell me how and where to get the correct request. Thanks!!!
"Try looking at the output of request.remoteAddr when viewing the site
from a different computer"
means that you will need to connect to the application running on your machine from another machine in your LAN.
If you have another machine in your LAN, you will need to find your local network IP address (use ipconfig) and from the other machine connect to this address. For example if your IP is 192.168.0.2, connect to http://192.168.0.2:8080
As tim_yates mentioned request.getRemoteAddr() may not always return the correct address due to dynamic addressing and proxy servers. However you may find the original address from various HTTP headers such as: HTTP_CLIENT_IP, HTTP_X_FORWARDED_FOR, HTTP_X_FORWARDED
Take a look at the answers to this question which provides more information about this subject.
That's the best you're going to get.
0:0:0:0:0:0:0:1
Is your local address. Also, this cannot be guaranteed to be unique to a user due to dynamic addressing and proxy servers

How do I make localhost:3000 available world-wide with my IP adress?

I have a Ruby on Rails application running on localhost:3000. I would like to make it available world-wide, using x.x.x.x:3000 (my IP address).
I'm on Windows XP SP3.
Disable your firewall(s)
Ensure you have port forwarding for your computer enabled in your router (if present)
Thats all! ;)
The key is to run it on the internet facing network adaptor, which might already be doing. You then need to to set up port forwarding on your ADSL or cable modem, if you are behind one (or a similar NAT device). Finally, get a friend to attempt to connect to you.
You might want to use a DNS service to alias your IP address, so people don't have to type it in by hand.
If you specifically need "localhost:3000", then go for #Joe answer, but if you do not care about the URL, you can use https://ngrok.com/.
Simply download it, then run ngrok localhost:3000 in terminal.
You would probably want to ensure that you have a static IP address to start with. You can apply to your ISP for one of these.
You then want to ensure that you have adequate security in place...there are tons of books etc about hardening your server.
If you have a static IP address, you'll need to turn off your firewall and you should be able to reach your machine. (Turning off your firewall isn't really a good idea, but that's a different question.)
If you have a dynamic IP address (you probably do if you're not sure), you need to look into something called "Dynamic DNS", as this will allow our computer to have a constant name, even if the IP address changes. Note that with all the technologies at play these days, your IP address locally is usually not the same one you see publicly. This can be a bit confusing if you're not sure what's going on.
All that being said, most people would opt for some sort of external hosting. This is much better from a security standpoint. Look at heroku for rails hosting. Their free option may be exactly what you need.
If you are running Apache on Windows, there is a button in the Apache tray icon. I can not recall the name but is something like ''go live''. And of course you have to set up the firewall or port forwarding on your router.
You answered your own question. IP addresses are unique over the internet. Just type in the x.x.x.x:3000 and you're there. If you want a human-readable address like yahoo.com, look into dyndns.com or other free domain-name services.

Resources