UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor skidaddytn
Visitor
970 Views
Registered: ‎11-17-2017

DNS not working with static IP

With petalinux, if I specify DHCP in the interfaces file, the DHCP server will provide DNS servers and they get saved into /etc/resolv.conf.   Everything works fine.

 

If I instead choose static IP definition and use the keyword "dns-nameservers x.x.x.x y.y.y.y", these numbers never get inserted into the "resolv.conf".    I can come back after "ifup", see that its empty, and then insert dns ip's *manually* and then the nameservers work.  But this resolv.conf file is supposed to be a "DO NOT EDIT" file...  so I don't think this is a good viable strategy long term.

 

I know its actually picking up on the term "dns-nameservers" when parsing the interfaces file because if I instead mis-spell and use "dns-nameserver", it then fails to even start the adapters.  

 

What is the trick to getting "dns-nameservers" to work from the interfaces file?  

0 Kudos
2 Replies
Visitor josie679
Visitor
785 Views
Registered: ‎09-22-2017

Re: DNS not working with static IP

Hello skidaddytn,

Did you ever get resolution to your issue?

I have a somewhat related issue. I am actually using dynamic IP addresses. The DHCP part works fine and I do actually see my dev board hostname showing up there. However, if I do a scan of my subnet the hostname does not get passed on. The DNS nameserver IP addresses do get passed down from DHCP correctly and are the correct addresses. I believe there is something missing from my Petalinux image/rootfs that is preventing the hostname association from being resolved.

Any help is appreciated.

josie679

 

0 Kudos
Highlighted
Visitor skidaddytn
Visitor
611 Views
Registered: ‎11-17-2017

Re: DNS not working with static IP

I'm getting proper resolving of names from petalinux.  I had to edit /etc/resolv.conf to get there (when using static ip).   Make sure you are specifying your domain suffix properly (i.e. abcinc.domain) .  In this way when you access by "ping mymachine" it will actually "ping mymachine.abcinc.domain"

I have in resolv.conf:

domain abcinc.domain

nameserver 1.2.3.4

nameserver 1.2.3.5

 

Basically I have a small app I wrote that runs at startup.  It reads an platform independent INI file from an sd card, then creates platform specific (LF line endings) /etc/resolv.conf and /etc/network/interfaces, and brings up the network.   The interfaces file that I include in my petalinux-build just specifies manual startup so I don't get any jittering.

 

0 Kudos