Can anyone tell me the logic of hosts and resolv.conf?
Hi,
Let's say my 10.0.0.4 has ftp server, and it's domain name is ftp.com, and ftp.com is already mapped on it's external ip:75.0.0.1 assume ftp.com from any browser reaches to 75.0.0.1 so how this 10.0.0.4 takes this address and knows that 75.0.0.1 is actually 10.0.0.4 ?? i played with resolv.conf with no luck. any help will be appreciated, with a little explanation as to why. Thank you, |
Various services listen to incoming ports. Traditionally there is a gateway computer with the external WAN IP (e.g. a "router") which forwards TCP/IP packets to a host in the subnet based on the nature of the request. For example, An HTTP GET to port 80 goes to a predefined IP (on which the web server listens) in the local network by virtue of being on port 80.
I believe what you are asking about actually has nothing to do with the files you've brought up. /etc/hosts is not that important if you have a properly configured DHCP server on the network. It's sort of a legacy file at this point, imho. (Disagreements?) /etc/resolv.conf specified places to resolve hostnames into ip's, i.e. "oh, hostname is actually hostname.domainname.com". Or, "I'll ask the dns server at 33.44.55.66". |
This is something that would tend to be done in a gateway router / firewall device, rather than on the local machine.
Rob |
Thanks James, Rob,
So how exactly I can make 10.0.0.4 (internal) machine be aware of 75.0.0.1 (external)? At the moment http://ftp.com is responding with a web page, I am assuming this is because Apache is listening to the port 80. but if i ping 75.0.0.1 from another machine, or try to access ftp server (which is working locally) from outside, (firewall is set correctly), it doesn't respond. I guess, 10.0.0.4 doesn't have any idea what to do when it receives 75.0.0.1 yet. What files do i change? So that each and every port on the local machine is responding to external requests? domain name : ftp.com ext ip : 75.0.0.1 int ip : 10.0.0.4 Thanks, |
Quote:
Quote:
Quote:
Rob |
Thanks for pointing out that I was looking at the wrong direction. It was my proftpd server that was not responding, and i checked that there is a parameter you can set:
AllowForeignAddress on and this was the problem. But it was nice to know about the things you mentioned. Cheers, |
All times are GMT -5. The time now is 12:34 PM. |