Power Global

 View Only
Expand all | Collapse all

How do you configure DNS on VIOS?

  • 1.  How do you configure DNS on VIOS?

    IBM Champion
    Posted Wed June 21, 2023 10:32 AM

    I am running 3.1.4.21 of VIOS.

    Recently I was trying stuff like sending a file and it quickly became apparent that there were no binding to any DNS servers set up on this lpar of vios.

    I tried a few google searches and got no where.  How do I set it up so the following works?

    $ ping ibm.com
    Some error messages may contain invalid information
    for the Virtual I/O Server environment.
    0821-062 ping: host name ibm.com NOT FOUND
    I know the IP addresses of our internal DNS servers.  I just don't know how to enter them in VIOS.


    ------------------------------
    Robert Berendt IBMChampion
    ------------------------------


  • 2.  RE: How do you configure DNS on VIOS?

    IBM Champion
    Posted Wed June 21, 2023 10:36 AM

    Is this it?

    https://www.ibm.com/docs/en/aix/7.1?topic=resolution-configuring-host-use-name-server

    If so, now I have to figure out how to edit a file on VIOS.  I'm more of an IBM i guy.



    ------------------------------
    Robert Berendt IBMChampion
    ------------------------------



  • 3.  RE: How do you configure DNS on VIOS?

    IBM Champion
    Posted Wed June 21, 2023 11:03 AM

    That worked.  I did a touch to create the file.  Used binary ftp (by ip address) to an IBM i.  Used edtf to edit it to look like

    domain dekko.com
    nameserver 10.10.4.250
    nameserver 10.27.4.180
    nameserver 10.17.4.180
    search corp.dekko.com dekko-1

    Then I used binary ftp to get it back.  Now ping by name works.



    ------------------------------
    Robert Berendt IBMChampion
    ------------------------------



  • 4.  RE: How do you configure DNS on VIOS?

    IBM Champion
    Posted Thu June 22, 2023 11:20 AM

    I love the approach that you used Robert.  Sometimes we have to jump through some hoops and solve a problem with the tools that we have at our disposal!



    ------------------------------
    Steven Riedmueller Certified IBM i Admin - Speaker, Mentor, and Advocate
    ------------------------------



  • 5.  RE: How do you configure DNS on VIOS?

    IBM Champion
    Posted Thu June 22, 2023 08:42 PM
    Your resolv.conf file is not self-consistent.

    Do you want short names to be resolved with "dekko.com" or "corp.dekko.com"? Your current config will never try "dekko.com". Also, "domain" and "search" are mutually exclusive, and "domain" has been deprecated for some time.

    As mentioned by others, cfgnamesrv is the VIOS-approved way to configure the resolver.

    -- 
    Stephen L. Ulmer
    Enterprise Architect
    Mainline Information Systems

    This e-mail and files transmitted with it are confidential, and are intended solely for the use of the individual or entity to whom this e-mail is addressed. If you are not the intended recipient, or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you are not one of the named recipient(s) or otherwise have reason to believe that you received this message in error, please immediately notify sender by e-mail, and destroy the original message.





  • 6.  RE: How do you configure DNS on VIOS?

    IBM Champion
    Posted Wed June 28, 2023 02:02 PM

    Thank you.  Something led me to believe that dekko.com would automatically be in the search list since it was the domain.  I tested that by adding three names to our dns:  gollum.dekko.com, mordor.corp.dekko.com and sauron.dekko-1.  Then I tried a ping by short name only.  The former one, gollum, did not resolve.  The latter two did.  I'll fix that.



    ------------------------------
    Robert Berendt IBMChampion
    ------------------------------



  • 7.  RE: How do you configure DNS on VIOS?

    IBM Champion
    Posted Thu June 22, 2023 02:45 AM

    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
    ------------------------------



  • 8.  RE: How do you configure DNS on VIOS?

    Posted Thu June 22, 2023 02:08 PM

    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.com


    The postings on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
    ------------------------------



  • 9.  RE: How do you configure DNS on VIOS?

    IBM Champion
    Posted Wed June 28, 2023 02:19 PM

    I like to configure the name servers for a lot of reasons, not the least being that if it tries a call home to ibm it can find the address.



    ------------------------------
    Robert Berendt IBMChampion
    ------------------------------



  • 10.  RE: How do you configure DNS on VIOS?

    Posted Mon June 26, 2023 06:36 AM

    Hi,

    Another way of adding DNS server is using AIX "smitty" utility.

    1. Exit padmin shell using oem_setup_env
    2.  Use smitty tcpip
    3. Select Further Configuration
    4. Select "Name Resolution" and Domain Nameserver
    5.  Select "Add a Nameserver" and add the IP address of DNS server you want to use

    Tsvetan



    ------------------------------
    Tsvetan Marinov
    ------------------------------



  • 11.  RE: How do you configure DNS on VIOS?

    IBM Champion
    Posted Wed June 28, 2023 02:09 PM

    I remembered something in my notes about smitty.  However the notes were jumbled and led me to believe that I would have to do it for each port and that seemed nuts.  I did use your example to add dekko.com to my search list.  Getting used to when to tab, enter and F10 was a little challenging.  But getting all the way out and back in did show it taking.  That, and the ping to an entry in dekko.com now working was a good verification.

    Thank you.



    ------------------------------
    Robert Berendt IBMChampion
    ------------------------------



  • 12.  RE: How do you configure DNS on VIOS?

    Posted Tue June 27, 2023 01:19 PM

    Hello there, this a little review about the command that you have to used on VIOS.

    To add a domain entry :

    # cfgnamesrv -add -dname abc.aus.century.com

    To add a name server entry :

    # cfgnamesrv –add -ipaddr 192.9.201.1

    To display all the DNS entries :

    # cfgnamesrv -ls



    ------------------------------
    Juan Martin Araya Carrasco
    ------------------------------