Change host resolution in Linux

I am told that during disaster  recovery, I need to change a host sftp to another IP address in a server PNS01.

I connect the PNS01 and reviewing the /etc/resolv.conf.  It has the following entries:
search wh.mydomain
nameserver 127.0.0.1
nameserver x.x.x.x
nameserver y.y.y.y.

1. How can I know  which NS will be responsbile to resolve currepnt host sftp server ?
2. Can simply  add a new entry under resolv.conf :
     sftp   z.z.z.z  (ie. IP of another SFTP server).

Tks
AXISHKAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Zephyr ICTCloud ArchitectCommented:
Sorry your question is a little unclear, but I think you are asking how to change a DNS record for an FTP server when it would be down... PNS01 is your DNS server I imagine.

You cannot add this into resolv.conf, that file is for the DNS servers the system uses.

You need to adjust zone files of the Named service or also known as Bind.
For starters, Named uses the config file under /etc/named.conf.
When you check that file you might find a reference to the zone files, which are usually under /var/named

Ones you find the correct zone files to adjust, you can change or add an IP/name in those files.

So, first check the /etc/named.conf file with something like "cat /etc/named.conf", scroll down and look for something like this:

zone "your-domain.com" {
type master;
file "/var/named/your-domain.com.db";
notify yes;
allow-transfer { Slave-Server; };
};

Open in new window


You notice this : /var/named/your-domain.com.db
It can be named different, but a file like this should be in /var/named/

You have two zone files normally, 1 for forward lookups and one for reverse lookups, you should adjust the IP in both files.
AXISHKAuthor Commented:
under /etc/named.conf,

zone "0.0.127.in-addr.arpa" {
        type master;
        file "db.127.0.0";
};

include "forward.conf";
include "reverse.conf";

I can't find /var/named in the file.

Any idea ?

Tks
Zephyr ICTCloud ArchitectCommented:
Check these files, sometimes admins configure it like that

include "forward.conf";
include "reverse.conf";

They are either under /etc/named/--
or under /var/named/ --
AXISHKAuthor Commented:
Tks,

After changing the record, should I restart the daemon. Which one to restart ?
Zephyr ICTCloud ArchitectCommented:
you could restart it yes, probably this one:
service named restart 

Open in new window


But you can also test to see if it works without restart by using nslookup for instance,

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.