In this paper, we consider the distributed estimation problem of a linear stochastic system described by an autoregressive model with exogenous inputs (ARX) when both the system orders and parameters are unknown. We design distributed algorithms to estimate the unknown orders and parameters by combining the proposed local information criterion (LIC) with the distributed least squares method. The simultaneous estimation for both the system orders and parameters brings challenges for the theoretical analysis. Some analysis techniques, such as double array martingale limit theory, stochastic Lyapunov functions, and martingale convergence theorems are employed. For the case where the upper bounds of the true orders are available, we introduce a cooperative excitation condition, under which the strong consistency of the estimation for the orders and parameters is established. Moreover, for the case where the upper bounds of true orders are unknown, similar distributed algorithm is proposed to estimate both the orders and parameters, and the corresponding convergence analysis for the proposed algorithm is provided. We remark that our results are obtained without relying on the independency or stationarity assumptions of regression vectors, and the cooperative excitation conditions can show that all sensors can cooperate to fulfill the estimation task even though any individual sensor can not.