The petitioner, Kevin Jon Weidenbacher, appeals from the judgment of the trial court dismissing his habeas corpus petition. He claims that the trial court improperly determined that he did not have standing to bring a habeas corpus petition for the purpose of establishing his paternity. We affirm the judgment of the trial court.
The state trial referee to whom the matter had been referred found that the respondents, Donna J. Duelos and Edward L. Duelos, were married on October 14, 1988. On October 31, 1988, a son, Grant Edward Duelos, was born to the respondents. His birth certificate lists Edward L. Duelos as the father. On November 14,1990, the respondents’ marriage was dissolved. The judgment of dissolution provided that Grant Duelos was the issue of the respondents’ marriage, and awarded custody to Donna Duelos. Edward Duelos received liberal visitation rights, and was ordered to pay $135 per week in child support. The habeas referee concluded that Edward Duelos is the “legitimate, legal father” of Grant Duelos.1
The petitioner labels his action, brought December 15,1992, as “Habeas Corpus Concerning Custody of Child,” and alleges that he is the natural father of Grant Edward Duelos, that he is a fit person to have custody of and control over and visitation rights with the child, that the child’s welfare will best be served *131by placing the child in his custody, and that the child’s mother refuses to surrender the child. The petitioner seeks immediate physical custody or immediate rights of visitation, and claims that he has no other plain, speedy or adequate remedy at law.2 The return by both respondents denies that the petitioner is the father of the child, and alleges that the petitioner has brought three other actions in the Superior Court and Probate Court for the district of Middletown arising out of the same circumstances. The petitioner first brought a Superior Court action, which was withdrawn on July 13,1992. He next filed a petition in the Probate Court, which appointed for the minor child an attorney who filed a written brief in that court arguing that the case should be dismissed. The case was dismissed on October 14,1992, pursuant to General Statutes § 46b-172a.3 Finally, a third party motion to intervene in the dissolution action was withdrawn on November 30, 1992. The dissolution action went to judgment in 1990.
In regard to the habeas petition currently at issue, the respondents filed a motion to dismiss the petition on the ground that the petitioner lacked standing. The referee granted the motion to dismiss stating that “Connecticut courts have not extended the use of the writ of habeas corpus to a putative father seeking to challenge the paternity of a legitimate child.” The referee also cited the strong public policy interest in protecting children from the “effects of illegitimacy” and *132in maintaining the “integrity of family relationships.” The petitioner appeals from the judgment dismissing the petition.
General Statutes § 52-466 authorizes the filing of an application for a writ of habeas corpus.4 “A habeas corpus action has long been recognized in Connecticut as the proper procedure to determine the custody of a minor child. Kearney v. State, 174 Conn. 244, 249, 386 A.2d 223 (1978); Adamsen v. Adamsen, 151 Conn. 172, 178, 195 A.2d 418 (1963); 2 Stephenson, Conn. Civ. Proc. § 259.” Nye v. Marcus, 198 Conn. 138, 140-41, 502 A.2d 869 (1985).
In contrast to the usual habeas corpus case, the illegality of confinement is not at issue in a custody matter.5 Pi v. Delta, 175 Conn. 527, 530, 400 A.2d 709 (1978); Howarth v. Northcott, 152 Conn. 460, 464, 208 A.2d 540 (1965). Rather, “[a] habeas corpus petition concerning a minor child’s custody is an equitable proceeding in which the trial court is called upon to decide, in the exercise of its sound discretion, the custodial placement which will be best for the child. Nye v. Marcus, [supra, 198 Conn. 141]; McGaffin v. Roberts, 193 Conn. 393, 403, 479 A.2d 176 (1984), cert. denied, 470 U.S. 1050, 105 S. Ct. 1747, 84 L. Ed. 2d 813 (1985).” Evans v. Santoro, 6 Conn. App. 707, 709, 507 A.2d 1007 (1986). “The legal rights of no one, includ*133ing a parent, are allowed to militate against this.” Doe v. Doe, 163 Conn. 340, 343, 307 A.2d 166 (1972). Although the best interests of the child are the main concern of the court, that issue cannot be litigated by a party who lacks standing. Nye v. Marcus, supra, 141.
“Standing is not a technical rule intended to keep aggrieved parties out of court; nor is it a test of substantive rights. Rather it is a practical concept designed to ensure that courts and parties are not vexed by suits brought to vindicate nonjusticiable interests and that judicial decisions which may affect the rights of others are forged in hot controversy, with each view fairly and vigorously represented.” Maloney v. Pac, 183 Conn. 313, 320, 439 A.2d 349 (1981). “When standing is put in issue, the question is whether the person whose standing is challenged is a proper party to request an adjudication of the issue and not whether the controversy is otherwise justiciable, or whether, on the merits, the plaintiff has a legally protected interest that the defendant’s action has invaded. Flast v. Cohen, [392 U.S. 83, 99-100, 88 S. Ct. 1942, 20 L. Ed. 2d 947 (1967)].” Mystic Marinelife Aquarium, Inc. v. Gill, 175 Conn. 483, 492, 400 A.2d 726 (1978). While determining the existence of a “legal interest” requires consideration of the merits of a case, “standing” depends on whether the complainant’s interest is arguably within the zone of interests protected by the relevant statute or constitutional guarantee. Id.
In reaching its conclusion that the petitioner did not have standing to seek a writ of habeas corpus, the trial court quoted Forestiere v. Doyle, 30 Conn. Sup. 284, 286, 310 A.2d 607 (1973), stating that in order to bring his petition, the petitioner needed to have a “special interest,” the essential elements of which are “parenthood, cohabitation and support.” The petitioner argues that he has standing to litigate a habeas corpus petition on the basis of his allegations of parenthood and *134financial support of Grant Duelos,6 which he claims constitute a special interest in the custody of that minor child. He cites Doe v. Doe, supra, 163 Conn. 340, and Pi v. Delta, supra, 175 Conn. 527, as authority for his position.
In Doe v. Doe, supra, 163 Conn. 340, the petitioner filed a petition for a writ of habeas corpus to obtain custody and visitation rights as to Craig and Beverly, two minor children. His petition alleged that he was the biological father of Craig only, but treated both children equally as his own; that the respondent was the mother of both children; that during the ten years he and the respondent had lived together, she held out the petitioner to the community as the father of both children; and that he supported the children. Id., 341-42. The respondent successfully moved to quash the petition on the grounds that the petitioner had failed to allege guardianship7 of either child by reason of marriage or adjudication and that, as to Beverly, he had failed to allege parenthood.
On the petitioner’s appeal from the denial of standing to petition for visitation rights, the Doe court determined that the trial court did not improperly grant the motion to quash insofar as it related to Beverly, because the petitioner did not allege parenthood or guardianship. Id., 345. The court set aside the judgment, however, insofar as it related to Craig, in light of Stanley v. Illinois, 405 U.S. 645, 651, 92 S. Ct. 1208, 31 L. Ed. 2d 551 (1972), which held that “ ‘[t]he private interest ... of a man in the children he *135has sired and raised, undeniably warrants deference and, absent a powerful countervailing interest, protection.” Doe v. Doe, supra, 163 Conn. 340, has been interpreted as holding, among other things, that “only parents or legal guardians of a child have standing to seek habeas corpus relief.” Nye v. Marcus, supra, 198 Conn. 143.
In Pi v. Delta, supra, 175 Conn. 527, standing was further extended to a biological father who sought a writ of habeas corpus to determine custody of his four illegitimate children despite the absence of any allegation that a period of support and cohabitation had existed. The court perceived “no valid reason for denying the admitted natural father of an illegitimate child at the least the opportunity to obtain a judicial determination of custody where, as here, there is an allegation that the present custodian is unfit and that the interests of the children will best be served by a change in custody.” Id., 533. Here, the petitioner argues that the dismissal of his petition for a writ of habeas corpus should likewise be set aside, as “there clearly has been an allegation which is supported by substantial evidence that the [petitioner] is the father uf the minor child.”
Regardless of the petitioner’s allegation of paternity in the present suit, neither Doe nor Pi controls our disposition of this case. Unlike the petitioner in Doe, the petitioner here does not allege that he played a significant part in raising the child he claims to be his son, nor does he allege that the present custodian is unfit, or that the child was bom out of wedlock. The petitioner merely alleges that it would be in the child’s best interest for him to have custody or visitation rights. The allegation that the present custodian was unfit played an important role in the Pi court’s decision. Pi v. Delta, supra, 175 Conn. 533; see also General Statutes § 45a-610; McGaffin v. Roberts, supra, 193 Conn. 406.
*136Although relevant, the differences between the allegations of the petitions in the cases cited by the petitioner and the allegations in this case are minor in comparison to the crucial distinction between this case and the cases on which the petitioner attempts to rely. In both Doe and Pi, the petitioners were unwed fathers of children who had been born out of wedlock. In this case, the petitioner is seeking to establish parental rights to a child who was born during wedlock. There is a presumption in this state that a child born during wedlock is the child of the husband, which presumption may be rebutted only by clear and convincing proof that the child is illegitimate. Holland v. Holland, 188 Conn. 354, 357, 449 A.2d 1010 (1982); Schaffer v. Schaffer, 187 Conn. 224, 226, 445 A.2d 589 (1982). The petitioner in essence claims that he has standing to seek the opportunity to rebut that presumption.
In contrast to a child born out of wedlock, whose putative father may file a claim for paternity pursuant to General Statutes § 46b-172a, a child born during wedlock may not have his or her legitimacy challenged by a stranger to the marriage. Indeed, the statutes allowing a challenge to the presumption of legitimacy are very limited in scope. General Statutes § 46b-160 (a) entitles a mother to institute proceedings to establish the paternity of a child “born or conceived out of lawful wedlock, including one bom to, or conceived by, a married woman but begotten by a man other than her husband.” (Emphasis added.) Additionally, General Statutes § 46b-55 (b) authorizes a child born during a marriage that is terminated by a dissolution or divorce decree to establish the identity of his biological father within one year of the judgment of divorce or decree of dissolution if the child is found not to be the issue of the marriage. In this case, the judgment of dissolution specifically provided that the child was the issue of the respondents’ marriage. Furthermore, both of *137the respondents, the mother of the child and her ex-husband, who was ordered in the dissolution decree to support the child and who has done so, deny that the petitioner is the father.
This state does not have a statute that authorizes an outsider to a marriage to initiate proceedings to establish his paternity of a child born during that marriage. In light of the existence of § 46b-160 (a), it is clear that the legislature was aware of the category of children that are born during wedlock but are not sired by the husband. We must assume that the legislature has consciously chosen to exclude parties outside the marriage from those entitled to raise the issue of paternity.8
The petitioner’s interest in establishing his paternity of a child born during wedlock is not one that is protected by the statutes or caselaw of this state.9 See Mystic Marinelife Aquarium, Inc. v. Gill, supra, 175 Conn. 492. Consequently, the trial court properly dismissed his petition for a writ of habeas corpus for lack of standing.
The judgment is affirmed.
In this opinion the other judges concurred.
No counsel was appointed for Grant Duelos in the habeas proceeding, although one was appointed in a prior action involving him in the Probate Court. Because the threshold question for the trial court was jurisdictional, namely whether the petitioner had standing to bring a writ of habeas corpus, it was not necessary to appoint counsel. Nye v. Marcus, 198 Conn. 138, 146, 502 A.2d 869 (1985).
The petitioner, simultaneously with the petition for habeas corpus, filed a motion for a court-ordered blood test of Donna Duelos and Grant Duelos, to which the respondents objected. The referee refused to act on the motion because of the dismissal of the habeas petition.
General Statutes § 46b-172a provides in pertinent part: “(a) Any person claiming to be the father of a child bom out of wedlock may at any time . . . file a claim for paternity with the court of probate for the district in which either the mother or the child resides . . . .” The Probate Court dismissed the petition for lack of jurisdiction because Grant Duelos was bom in wedlock.
General Statutes § 52-466 provides in pertinent part: “(a) An application for a writ of habeas corpus shall be made to the superior court or to a judge thereof for the judicial district in which the person whose custody is in question is claimed to be illegally confined or deprived of his liberty
In his petition for either custody or visitation rights regarding Grant Duelos, the petitioner'does not allege that the respondent Donna Duelos has “illegally confined or deprived” the child of his liberty. The petitioner, however, bases his right to either remedy on his alleged paternity. If a court has jurisdiction of a habeas corpus petition seeking custody, it also has jurisdiction to award visitation. See Evans v. Santoro, 6 Conn. App. 707, 709, 507 A.2d 1007 (1986).
The petition contains no allegation that the petitioner has provided support to Grant Duelos. Such an allegation, however, would not give the petitioner standing, in light of the other facts of this case.
General Statutes (Cum. Sup. 1967) § 45-43 provided in part: “The mother of each illegitimate child under twenty-one years of age shall be the sole guardian of the person of such child.” That sentence has since been deleted from the statute, which has been further amended and transferred to General Statutes § 45a-606.
The United States Supreme Court has determined that as a matter of social policy, a state may deny an outsider to a marriage the opportunity to challenge the presumption that a child born during that marriage is that of the husband. Neither the alleged biological father nor the child has a fundamental right to maintain a parent-child relationship with the other. Michael H. v. GeraldD., 491 U.S. 110, 109 S. Ct. 2333, 105 L. Ed. 2d 291 (1989).
The interest of a putative father in obtaining custody or visitation rights to a child he claims is his may be protected through General Statutes §§ 46b-57 or 46b-59. Custody and visitation may not, however, be collaterally attacked after a judgment as to those matters has been rendered.