0

I have hostname in /etc/hosts,
10.0.0.124 hostname.domain hostname
I can ping and ssh to hostname. When I enter
ftp 10.0.0.124
or ftp hostname
I get "No route to host" in response. When I comment out that line, and try
ftp hostname
ftp responds "Name or service not known". So ftp is looking in the hosts file but apparently does not believe it. Why not?? I am on CentOS 6.5 and ftp was installed using yum install ftp. The ftp daemon running on hostname is vsftpd.

ChrisDR
  • 185
  • 12
  • What happens if you use `ping` instead of `ftp`? – Mark Setchell Aug 19 '15 at 18:10
  • Edited post already. I can ping hostname, no problem. I think the problem might actually be with the ftp daemon on hostname, but not had a chance to investigate further yet. – ChrisDR Aug 20 '15 at 05:55
  • Edited post already. I can ping hostname, no problem. I think the problem might actually be with the ftp daemon on hostname, but not had a chance to investigate further yet. Wait, I think you were not asking the question I answered. When hostname is not in the hosts file, ping does not see the host either. ftp gives the response name or service not known. When hostname is in the hosts file, ping sees the host and ftp gives the response no route to host. – ChrisDR Aug 20 '15 at 07:23

1 Answers1

0

And fixed! The problem was that hostname's firewall was configured to drop ftp packets. Obvious! Inserted
-A INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
in /etc/sysconfig/iptables, and restarted iptables service. Done!

ChrisDR
  • 185
  • 12