Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

i have shell scripts in my redhat server written by previous administrator, which downloads some files from external FTP servers.

lftp -c 'open -e "repeat 10 source getfiles.script" host1' > out_get.out 2>&1
lftp -c 'open -e "repeat 10 source getfiles.script" host2' > out_get.out 2>&1

As i been informed, those scripts were working before, after some changes done in external FTP servers(host1/host2) now its stopped working.

Here in lftp commands username and password for host1 and host2 are not specified, how can it be possible to connect to external FTP servers without any credentials ?

On the host names, how to check the real IP of "host2" ? its not registered in hosts file and when i ping host1 it says unknown host. But ping host2 - displays domain name and real ip but 100% package lost.

Some thoughts: 1. host1 not registred in DNS servers 2. host2 registred in DNS servers but ping gets 100 package lost becouse firewall blocks the connection. Any other ideas ?

I have 2 DNS servers registered in resolv.conf:

nameserver X.X.X.2 
nameserver X.X.X.3 

etc/nsswitch.conf:

#
# /etc/nsswitch.conf
#
# An example Name Service Switch config file. This file should be
# sorted with the most-used services at the beginning.
#
# The entry '[NOTFOUND=return]' means that the search for an
# entry should stop if the search in the previous entry turned
# up nothing. Note that if the search failed due to some other reason
# (like no NIS server responding) then the search continues with the
# next entry.
#
# Legal entries are:
#
#       nisplus or nis+         Use NIS+ (NIS version 3)
#       nis or yp               Use NIS (NIS version 2), also called YP
#       dns                     Use DNS (Domain Name Service)
#       files                   Use the local files
#       db                      Use the local database (.db) files
#       compat                  Use NIS on compat mode
#       hesiod                  Use Hesiod for user lookups
#       [NOTFOUND=return]       Stop searching if not found so far
#

# To use db, put the "db" in front of "files" for entries you want to be
# looked up first in the databases
#
# Example:
#passwd:    db files nisplus nis
#shadow:    db files nisplus nis
#group:     db files nisplus nis

passwd:     files
shadow:     files
group:      files

#hosts:     db files nisplus nis dns
hosts:      files dns

# Example - obey only what nisplus tells us...
#services:   nisplus [NOTFOUND=return] files
#networks:   nisplus [NOTFOUND=return] files
#protocols:  nisplus [NOTFOUND=return] files
#rpc:        nisplus [NOTFOUND=return] files
#ethers:     nisplus [NOTFOUND=return] files
#netmasks:   nisplus [NOTFOUND=return] files

bootparams: nisplus [NOTFOUND=return] files

ethers:     files
netmasks:   files
networks:   files
protocols:  files
rpc:        files
services:   files

Thanks a lot.

share|improve this question
    
I don't think you can get a helpful answer for this question without more information. Particularly, what is your organization's relationship with the organizations running the servers? Are they providing specific information for you, or are you attempting to consume something that's published for everyone? And, you mention "some changes done in external FTP servers" — what are those changes? Every possible detail helps. –  mattdm Dec 5 '10 at 14:14
    
Also, unless name resolution is broken in general on your system, is there any reason you're fixated on /etc/resolv.conf and your NSS configuration? If the outside FTP service has changed, isn't it most likely that the name has just changed from what you had? –  mattdm Dec 5 '10 at 14:16
    
And finally, since your problem is "my automated ftp scripts broke", the question probably shouldn't be titled "How to resolve IP address by host/alias name". –  mattdm Dec 5 '10 at 14:17
add comment

1 Answer

You can use nslookup or dig:

nslookup www.google.com
dig www.google.com

to get the IPs of the hostname. Note that, given what you said, it probably won't give you any more info.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.