How does ping resolve ip addresses? [closed] - tcp

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
The ping utility works above the network layer and DNS works in the application layer.
If we try ping www.google.com, how does it resolve the IP address of GOOGLE since the DNS is above these layers?

ICMP (the protocol) may operate above IP, alongside TCP but a ping program itself almost certainly still uses the normal methods for name resolution, be that DNS, hosts file or resolv.conf.
For example, the ping program located here calls on gethostbyname() to turn DNS names into IP addresses.

Certainly on windows computers, ping also uses LLMNR (Link-Local Multicast Name Resolution) to perform hostname resolution.
A host may be pinged just fine while other services still fail if a computer is only known by LLMNR and the failing service relies on DNS.
Vice versa: DNS may work but ping fails

Hostnames are still resolved through DNS, after that ping uses ICMP for the actual communication. You can try changing the DNS configs to invalid servers and see that ping won't work with hostnames.

Related

Draytek vigor 2820 force specific traffic via static IP [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I've got a Draytek Vigor 2820 that's used to connect to the internet. WAN1 is used as an ADSL backup, and WAN2 is our main fibre connection. WAN2 has a total of 6 IP addresses, a single dynamic one and 5 static IPs and is configured up as a PPPoE connection with DynamicIP.
I use NAT Port Redirection to open up some specific ports to various servers (web development, FTP, RDC etc)
I use NAT Open Ports to open up some static IP ports to specific servers
I use NAT Address Mapping to force all traffic received on one static IP to our Exchange server
What I want to do is to force outgoing traffic to use one of the static IPs and have hit a brick wall. Ideally I'd like to force specific traffic but would settle for all!
Under LAN is the ability to configure Static Routes, but this is purely there to allow internal routing (for VLANs).
Anybody else who has this type of router and can give me any suggestions?
OK, managed to work this one out.
Under WAN > Internet Access, select WAN2
On the PPPoE page, change the "Fixed IP" to Yes and enter one of the static IP's into the Fixed IP Address box. Click OK and then reboot the router.
All traffic will now go from that IP address. If you go back to the same page and click WAN IP Alias, the top spot will have the IP address entered in it which will likely be repeated in the list, I just removed the 'double' from the NAT pool and everything seems to work OK.
Sadly there appears to be no way of having all traffic to one IP being sent via one static IP

Whatismyip and ifconfig giving different IP addresses [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I am looking to get the IP of my dev server. Everything online says to either do ifconfig or to curl something like whatismyip. These are giving me 2 different addresses. Why?
To add: I have no idea if it's behind a router or anything. I simply have an IP that I SSH into. I assumed that address was the address of the server - but when I curl http://ifconfig.me/ I get a completely different address.
Disclaimer: I have close to 0 networking knowledge.
You are most likely behind a router that does network address translation. Your ifconfig could be showing an IP address from a private range, such as 192.168.xxx.xxx.
An alternative is that your development server has several network interfaces, in which case ifconfig should be showing you several (such as eth0, eth1). However, I have the feeling it's the first, because you didn't mention this.
You could possibly check for the former with a tool such as tracepath, thereby discovering the nodes in between your development server and the other servers. But it might just be easier to check with the IT administrator(s) for your development server.
Well if you're behind a router that could be one reason.
If your dev server is externally facing it's entirely possible that the DNS server that whatismyip is using has a different IP entry than the DNS server ifconfig.me is using.
try running tracert www.yahoo.com from the command line and see what IPs shows up in the results.

Allow remote access to a localhost website in asp.net [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Hi I have developed a website and is on a machine(localhost), I want a friend to access it from outside my network, I have done some research and am being pointed to port forwarding as a solution. Any good links I can refer too will be highly appreciated.
Not a programming question, but how to setup your router.
The router, especial the adsl modems that you probably use, they not forward outside request to inside network, for security and because they are not know where to send them.
So on the setup of your router you need first of all forwarder the outside calls to your pc.
Now, this have two parameters, what port send to what inside ip.
How to forward ports on your router page with images and examples.
Let say that you have a pc behind the router at ip 192.168.1.100, and setup there a local iis on 80, then you need to setup the router so when is accept call on port 80, to send it to 192.168.1.100
Now you need to know what ip to give to your friend to try to make call to you, you can find it using the http://www.whatismyip.com/ The ip they see you outside is the one your friend must type on browser.
And then need to make your iis run, and allow your pc firewall to accept calls on port 80.
#Aristos gave you the answer. But have in mind that some internet providers block port 80 so you might have to change to 88 for example. And your friend will access it as
http://your_external_ip:88

IP address in LAN [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 12 years ago.
Improve this question
(1) What is my and others real IP address on same lan? Can we still have a unique IP despite the fact that we share the same router/LAN? and how does the IPs are assigned?
Thanks!
If you use a router to access the internet you probably have a DHCP Server running on the router as well.
This gives each computer a unique IP address wit a lease of x-days.
From the net only your public (mostly dynamic) ip address is shown to others.
Inside you private local net you have private ip addresses like 192.168.x.x/class C.
Easy way to find out your ip addess on your local computer:
open a cmd shell and type "ipconfig /all".
Then you see your IP address and also the gateway (which is your router).
Within a single LAN (which I'm defining here as a section of the net with no network address translation (NAT)), your IP address should be unique.
That's so that traffic can get to the correct machine.
However, it's never that simple. There's a good chance that the IP address the world sees you at is nothing like your local IP address. Your local address is probably 10.x.x.x or 192.x.x.x (from memory), one of a group of private IP ranges. For example, my Ubuntu box here is 10.1.1.2, an address that probably half a million other people on the planet have.
But my packets don't hit the internet with that source address since they go through a NAT router on my desk as well as a large number of other NAT'ting devices in my ISP.
It's this NAT process that allows all those private IP ranges to be usable.
As to how you get your IP addreses, you can set up static addresses (very useful for servers that you don't want changing) but the usual approach for non-server machines is to use a DHCP (dynamic host configuration protocol) server which manages the IP addresses and hands them out as required (on booting your client machine usually).
Typically, the DHCP server wil lock an IP address to a specific Ethernet MAC address for a period of time (in our corporate environment, it's three weeks). That means that, barring a four week holiday with your machine turned off, you should always have the same address.
Keep in mind that you may have more than one network card with separate IP addreses. You may even have a single network card with multiple IP addresses. In that case, you can be said to have more than one real IP address although I'd probably still say that it's the one servicing your default route (the source address your packets go out on by default).
It's a very ... interesting ... field to work in :-)

How an application or website finds your ip? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 12 years ago.
Improve this question
I think there are only two ways a application or a server could get your IP.
If it is an application, java/flash, I think it could check your network settings locally and send your IP back to the server. Then the server would know.
The other way it could find is that it could analyze the packet headers. Then find there your IP information.
But if I wanted it to stop doing it.
If it was analyzing locally my IP information I could stop that packet or change its information so the website would be confused about the IP information.
If it was analyzing the packet headers and if knew what packets it was analyzing because it wont analyze every packet, I could stop sending those packets.
Example:
Websites that checks your IP, how does it do it? If you are not downloading any application, you would exclude the 1. scenarion. Then the only possibility is that it was analyzing packet headers but what kind of packets?
It was not one question only but if anyone knows something about it, I would like to know too. :)
Thanks
You can't prevent a website to know your IP. If you do prevent it, it would be unable to answer your request. If you are really interested in anonymity have a look at proxy servers, especially at high anonymity proxies.
As soon as you establish a connection to a remote host, your IP address is revealed. You can not simply say, "I'd like to connect, and by the way, my IP address is 123.123.123.123".
The webserver will tell what ever script it executes, from which IP address the connection was established (and request made).
Your IP address is in every TCP segment. The remote web-server (to which your web browser makes the connection) will make this information available to the hosted site.
To send a different IP address, you have a couple of options. You could use a proxy server and have its IP address transmitted. Alternatively, you could use IP Spoofing, if you don't want to receive any information back!
You can't prevent a website from knowing the IP, that sent the request. At best you can route it through a proxy, so the website resolves the IP of the proxy server.
You should read up on TCP/IP. In short, TCP/IP packet contains the originating IP address, because it must conform to the IP protocol and send a valid IP header.

Resources