Network failure: Gateway is first entry in routing table.


I have QNX 6.2.1 (including CD update) installed on a Notebook with a 3COM PCMCIA card on a private network (192.168.100.X) and a gateway box ( Everything on the (private) network works fine until I add the gateway:

route add default

After that, I cannot even ping myself. Using route show -n, the reason seems to be that the gateway is the first entry in my routing table:

Destination Gateway
default ________ ______ __ link#2

I searched around this forum and googled around, but no one seems to have my particular kind of problem. Why is it that the default route is added to the start, not the end, of the routing table? And how can I change that?

Even as I tried to init everything using my DHCP server, the same result happens – default route first. Would be happily appreciating any suggestions.

Best regards,


I used to see this. Can you “ping -n 192.168.100.y” ?

It’s something to do with “ping” wants to resolve a name, and you have a DNS setting.
Without the default route, since it can’t reach your DNS server, the resolving faild very
quick. WIth a default route, the resolving goes to the “probably worng” nameserver…

Hi xtang,

Thanks for your swift reply. ping -n does the trick, even for IPs in the outer world (e.g. my nameserver can be pinged). Can you tell me the reason for ping asking DNS when I have given an IP address (sounds pretty unnecessary to me, at least)?

Next, the DNS server can be pinged, but is of no use (and yes, on the Linux machines they work). A e.g. ping -n fails.

Again, suggestions are very welcome. I’d be especially interested in which context you used to see this.

Best regards,


ping is try to translate back the address into it’s name. See this:

$ ping
PING ( 56 data bytes

ping is try to contact your DNS to get that “”.

As for DNS setting, could you do a “getconf CS_RESOLVE” (as root)
and post ?

getconf CS_RESOLVE

As I would expect. I also tried editing /etc/resolv.conf manually, since the GUI network configurator saves everything in /etc/net.cfg, but to no avail (why is there a resolv.conf, btw?).

Another thought is that it could be my firewall; on the other hand, my windows and linux machines do quite well with it. I also checked ifconfig for TCP and UDP, but both are available.

So, “” IS your name server, and you can ping to it? But you still can’t resolve ? hm…

Yes, I can ping it. It works on my other machines. I am pretty much awestruck.

Does “nslookup -” works ? Can this resolve any name ?

No, this does not work. I also tried this with my secondary nameserver (just to be sure) – this does not work either.

I have no idea. I would say the have problem, but you said it is working
with other boxes. Any difference between the QNX machine and other linux machine?
(network wise, does the QNX machine behind a firewall? things like that).
or maybe you need to setup proper domain just as your Linux box.

Are you able to nslookup through some wellknown server? For example, on my

$ nslookup


does your firewall/router allow outbound connection to port 53 ? for both tcp and udp.