For the folks in the future that find this thread with a similar problem, @Andrey Klyachkin pointed out, the VIOS way to do this is the cfgnamesrv command.
You can see details how to use it with: "help cfgnamesrv"
The "help" command on its own gives a list of the commands available organized into groups.
The way Robert handled by creating a /etc/resolv.conf file is the standard unix way of doing it, and is, in fact, what cfgnamesrv is doing under the covers. However if there is a VIOS way of doing something, it is preferred. In this case, mostly because it will get the format right of the files and permissions correct.
I LOVE the process Robert used to create the file. So creative! The Unix way to do that would be to use the vi command to edit the file. If you've never used vi, you will hate it. Unix guys use it because it is always available, but most of them hate it also.
An alternative method to transfer files to the VIOS is to use scp (secure copy) to transfer files using the ssh server that is always available on the VIOS. If you are using a modern version of Windows, there is usually a native scp command. This would be pscp if you are using Putty. You can also use most any of the file transfer tools such as WinSCP or Filezilla. Of course you also can use scp from your IBM i with the PASE environment, but you will need to make sure you get the file encoding right.
Specific to using name servers on VIOS: I generally skip the definition of name servers when setting up a new VIOS because if your networking is not working right, having a name server defined will put most VIOS commands into painfully slow mode as it attempts to resolve names and addresses. This is particularly noticeable during startup with a broken network connection. Unfortunately, the nature of new VIOS installations means that it is not at all unusual for the networking to be broken right out of the gate.
Once I am able to ping the name server, then I might use the cfgnamesrv command to add name servers if I want DNS resolution. To be completely honest, most of the time I will not configure name servers on a VIOS at all because it is not necessary for any of the normal functions of a VIOS, and the very slow startup with a broken network connection could be a problem in a DR scenario where you really need to get your VIOS up and running for client lpars while the network is still not fully functional.
------------------------------
Vincent Greene
IT Consultant
Technology Expert labs
IBM
Vincent.Greene@ibm.comThe postings on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
------------------------------
Original Message:
Sent: Thu June 22, 2023 02:44 AM
From: Andrey Klyachkin
Subject: How do you configure DNS on VIOS?
Hi Robert,
one of the first commands you usuall do on a fresh installed VIO is mktcpip. The command let you set IP address and DNS settings on your VIO server. If you don't want to reconfigure your complete TCP/IP stack you can use the command cfgnamesrv which exists specifically for DNS configuration.
cfgnamesrv -add -ipaddr 192.9.201.1
------------------------------
Andrey Klyachkin
https://www.power-devops.com
------------------------------