Using nslookup in

I am not able to do a dns lookup in ?
I have tried this : server_ip=$(nslookup pc.pc | grep -A 1 ‘Name:.'“pc.pc” | grep -o 'Address.1:.[0-9.]’ | awk ‘{print $3}’)

  • Verdin iMX8M Plus 8GB WB IT V1.1A
  • Verdin Development Carrier Board V1.1F
  • Torizon OS 6.5.0-build.8

What am I missing?

Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


When attempting to perform a DNS lookup using nslookup within a script on a Verdin iMX8M Plus with TorizonCore, there are a few considerations to ensure the command executes correctly. Your command seems to be attempting to parse the output of nslookup to extract an IP address, but there might be syntax issues or environmental constraints affecting its execution.

  1. Syntax Check: Ensure your command syntax is correct, especially the use of quotation marks and backticks. The command as provided seems to have formatting issues, particularly with the quotation marks. Ensure you’re using standard single (') or double (") quotes in the shell script.

  2. Network Configuration: Verify that the DNS service is correctly configured and accessible in your Torizon environment. If your container or the TorizonCore system does not have a proper DNS setup, nslookup will fail to resolve the hostname.

  3. Command Availability: Ensure that nslookup is available in your environment. nslookup might not be installed by default in the minimal TorizonCore containers. You may need to install it manually using your container’s package manager (e.g., apt-get install dnsutils for Debian-based containers).

  4. Alternative Approach: Consider using a different tool like dig or getent hosts if nslookup continues to give you trouble. These tools can also perform DNS lookups and might be more straightforward to use in scripts.

  5. Debugging: Add error handling in your script to catch and understand any issues. For instance, directly run nslookup pc.pc to ensure it outputs the expected result before parsing it.

  6. Permissions: Ensure your script has the necessary permissions to execute and that it’s running in an environment with network access.

If after these checks, you’re still facing issues, it might be helpful to directly test the nslookup command outside of the script to ensure the DNS resolution works as expected in your Torizon environment. Also, reviewing the network configuration on your Verdin iMX8M Plus and ensuring that the DNS servers are reachable from your device is crucial.

Best regards,
Toradex AI Assistant

Please, also check if these links can help you solve your problem:

Scan your local network to find the board IP and MAC address | Toradex Developer Center.

Dear @nat,

Thank you for contacting us and welcome to our community.

May I ask you what you would like to use it for? What is the grand goal behind it? We would like to know this, to ensure that it is really necessary, since is it is a part of “Toradex easy installer”.

Best regards

I am attempting to resolve the IP address of the TFTP server in order to send a message indicating that the Easy Installer has started.

Hello @nat,

It is possible, that there is an issue within your network.
Could you try nslookup pc.pc as well as cat /etc/resolve.conf after booting the Toradex easy installer and send us the outputs? Also have you tried this on another machine?

Best regards